Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » undefined reference when linking grabber with a4.4.2 on linux

Credits go to GullRaDriel for helping out!
This thread is locked; no one can reply to it. rss feed Print
undefined reference when linking grabber with a4.4.2 on linux
amarillion
Member #940
January 2001
avatar

I'm trying to build allegro 4.4.2 on linux (Ubuntu xenial), and I'm getting an undefined reference when linking grabber

Here is what I did:

#SelectExpand
1apt-get install cmake \ 2 pkg-config \ 3 texinfo \ 4 libxext-dev \ 5 libx11-dev \ 6 libxpm-dev \ 7 libxt-dev \ 8 libxcursor-dev \ 9 libasound2-dev \ 10 oss4-dev \ 11 libxxf86dga-dev \ 12 libxxf86vm-dev \ 13 libgl1-mesa-dev \ 14 libglu1-mesa-dev \ 15 libpng-dev \ 16 zlib1g-dev \ 17 libvorbis-dev 18 19wget http://download.gna.org/allegro/allegro/4.4.2/allegro-4.4.2.tar.gz 20tar -zxf allegro-4.4.2.tar.gz 21 22mkdir -p allegro-4.4.2/Build/Debug 23cd allegro-4.4.2/Build/Debug 24cmake -DCMAKE_BUILD_TYPE=Debug ../.. 25make

Here is the error I get:

#SelectExpand
1[ 91%] Building C object tools/CMakeFiles/aldat.dir/__/addons/jpgalleg/plugin/datjpeg.c.o 2[ 91%] Linking C static library ../lib/libaldat.a 3[ 91%] Built target aldat 4Scanning dependencies of target grabber 5[ 91%] Building C object tools/CMakeFiles/grabber.dir/grabber.c.o 6[ 91%] Linking C executable grabber 7../lib/libjpgalleg-debug.a(decode.c.o): In function `decode_baseline_block': 8/home/builder/allegro-4.4.2/addons/jpgalleg/src/decode.c:562: undefined reference to `get_value' 9/home/builder/allegro-4.4.2/addons/jpgalleg/src/decode.c:582: undefined reference to `get_value' 10../lib/libjpgalleg-debug.a(decode.c.o): In function `decode_progressive_block': 11/home/builder/allegro-4.4.2/addons/jpgalleg/src/decode.c:646: undefined reference to `get_value' 12/home/builder/allegro-4.4.2/addons/jpgalleg/src/decode.c:700: undefined reference to `get_value' 13collect2: error: ld returned 1 exit status 14tools/CMakeFiles/grabber.dir/build.make:106: recipe for target 'tools/grabber' failed 15make[2]: *** [tools/grabber] Error 1 16CMakeFiles/Makefile2:2919: recipe for target 'tools/CMakeFiles/grabber.dir/all' failed 17make[1]: *** [tools/CMakeFiles/grabber.dir/all] Error 2 18Makefile:127: recipe for target 'all' failed 19make: *** [all] Error 2

This seems to suggest a missing library when linking grabber, or maybe the wrong ordering of libraries. I tried to trace it down to the contents of tools/CMakeFiles/grabber.dir/link.txt

/usr/bin/cc   -W -Wall -Wno-unused-parameter -Wdeclaration-after-statement -g -DDEBUGMODE=1   CMakeFiles/grabber.dir/grabber.c.o  -o grabber -rdynamic ../lib/libaldat.a ../lib/libjpgalleg-debug.a ../lib/liballeg-debug.so.4.4.2 -lm -lpthread -lrt -lSM -lICE -lX11 -lXext -lXcursor -lXpm -lXxf86vm -ldl -Wl,-rpath,/home/martijn/allegro-4.4.2/Build/Debug/lib:

But I don't know what could be wrong here... Any ideas?

GullRaDriel
Member #3,861
September 2003
avatar

Where does that get_value come from ?
If maybe it comes from the allegro core library, then you should move ../lib/libjpgalleg-debug.a after ../lib/liballeg-debug.so.4.4.2 ?

EDIT: google gave me another answer:
https://sourceforge.net/p/alleg/bugs/398/

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

amarillion
Member #940
January 2001
avatar

Thanks, somehow my google foo was bad, because my searches didn't turn up that bug report.

Without this fix the out-of-the box experience of Allegro 4.4.2 is not great. Will there be a 4.4.2.1?

edit: the patch has been applied to git now. Looks like we'll have to get Allegro 4 from there for the time being.

Go to: