Page 1 of 1

[6031] Link error in Ubuntu 12.04 64 Bit

Posted: Thu May 16, 2013 10:27 am
by PhilSophus
Recent versions of FreeOrion (e.g. SVN r6031) fail to link on Ubuntu 12.04 x86_64:

Code: Select all

$ make VERBOSE=1
...
Linking CXX executable ../freeoriond
cd /cache/lw/freeorion_build/server && /usr/bin/cmake -E cmake_link_script CMakeFiles/freeoriond.dir/link.txt --verbose=1
/usr/bin/c++    -Wno-deprecated -Wall -Wno-parentheses -O3 -DNDEBUG    CMakeFiles/freeoriond.dir/__/network/ServerNetworking.cpp.o CMakeFiles/freeoriond.dir/SaveLoad.cpp.o CMakeFiles/freeoriond.dir/ServerApp.cpp.o CMakeFiles/freeoriond.dir/ServerFSM.cpp.o CMakeFiles/freeoriond.dir/dmain.cpp.o CMakeFiles/freeoriond.dir/__/universe/UniverseServer.cpp.o CMakeFiles/freeoriond.dir/__/util/AppInterface.cpp.o CMakeFiles/freeoriond.dir/__/util/VarText.cpp.o CMakeFiles/freeoriond.dir/__/combat/CombatSystem.cpp.o  -o ../freeoriond -rdynamic ../libcore.a ../libparse.a ../liblog4cpp.a ../libGiGi.so -lpthread /usr/local/lib/libboost_date_time-gcc46-mt-1_53.so /usr/local/lib/libboost_filesystem-gcc46-mt-1_53.so /usr/local/lib/libboost_serialization-gcc46-mt-1_53.so /usr/local/lib/libboost_signals-gcc46-mt-1_53.so /usr/local/lib/libboost_system-gcc46-mt-1_53.so /usr/local/lib/libboost_thread-gcc46-mt-1_53.so -lpthread -lGLU -lGL -lSM -lICE -lX11 -lXext ../libltdl.a -lpthread -lfreetype -ljpeg -lpng -lz -ltiff -Wl,-rpath,/cache/lw/freeorion_build:/usr/local/lib: 
../libGiGi.so: error: undefined reference to 'dlsym'
../libGiGi.so: error: undefined reference to 'dlerror'
../libGiGi.so: error: undefined reference to 'dlclose'
../libGiGi.so: error: undefined reference to 'dlopen'
collect2: ld returned 1 exit status
(same for freeorionca and freeorion).

Obviously libdl.so is missing in the link command and indeed manually executing above commands with "-ldl" added works. However, I have no experience with CMake, so don't know how to fix it properly.

Linking worked fine in r5980 in the same environment, so must be something changed in the last month.

Re: [6031] Link error in Ubuntu 12.04 64 Bit

Posted: Thu May 16, 2013 11:46 am
by adrian_broher
I can't reproduce this on Fedora 17. However, please check if the attached patch fixes your problem.

Re: [6031] Link error in Ubuntu 12.04 64 Bit

Posted: Thu May 16, 2013 2:12 pm
by PhilSophus
adrian_broher wrote:However, please check if the attached patch fixes your problem.
Yes, it does. Thank you!

Re: [6031] Link error in Ubuntu 12.04 64 Bit

Posted: Sat May 18, 2013 10:14 pm
by Geoff the Medio
committed