Menu

#398 Linking anything against allegro-4.4.2 fails on linux with gcc-5.2.0

4.4
open
nobody
gcc-5 (1)
1
2017-01-03
2015-09-03
Sven Eden
No

Allegro-4.4.2 fails to build (or more specific: Everything linked agains libjpgalleg.so.4.4.2 fails to link) when built with gcc-5.2.0.

Here is the error output when trying to link the grabber utility:


Linking C executable grabber
cd /home/portage/media-libs/allegro-4.4.2-r1/work/allegro-4.4.2/tools && /usr/bin/cmake -E cmake_link_script CMakeFiles/grabber.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-gcc -march=native -pipe -ggdb3 -O0 -ftree-vectorize -fstack-protector-strong -W -Wall -Wno-unused-parameter -Wdeclaration-after-statement -march=native -pipe -ggdb3 -O0 -ftree-vectorize -fstack-protector-strong -Wl,--sort-common -Wl,--hash-style=gnu CMakeFiles/grabber.dir/grabber.c.o -o grabber -rdynamic ../lib/libaldat.a ../lib/libjpgalleg.so.4.4.2 ../lib/liballeg.so.4.4.2 -ldl -lm -lpthread -lrt -lSM -lICE -lX11 -lXext -lXcursor -lXpm -lXxf86vm -ldl -Wl,-rpath,/home/portage/media-libs/allegro-4.4.2-r1/work/allegro-4.4.2/lib:
../lib/libjpgalleg.so.4.4.2: undefined reference to `get_value'
collect2: error: ld returned 1 exit status


The reason is simple: The mentioned function 'get_value()' is local to addons/jpgalleg/src/decode.c but not marked as static.

Changing it to "static INLINE" fixes the issue.

See attached patch.

1 Attachments

Discussion

  • Martijn van Iersel

    I ran into this bug as well, and I can confirm the patch fixes it.

     
  • Trent Gamblin

    Trent Gamblin - 2017-01-03

    I applied the patch to the 4.4 branch on GitHub. Please direct any bug reports/comments to GitHub from now on.

    Not sure if we'll ever do another 4.4 release. For now you'll have to build from source.

     
  • Martijn van Iersel

    Thanks Trent

     

Log in to post a comment.