[6031] Link error in Ubuntu 12.04 64 Bit

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
PhilSophus
Krill Swarm
Posts: 11
Joined: Thu May 16, 2013 9:52 am
Location: Germany

[6031] Link error in Ubuntu 12.04 64 Bit

#1 Post 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.

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

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

#2 Post by adrian_broher »

I can't reproduce this on Fedora 17. However, please check if the attached patch fixes your problem.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

PhilSophus
Krill Swarm
Posts: 11
Joined: Thu May 16, 2013 9:52 am
Location: Germany

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

#3 Post by PhilSophus »

adrian_broher wrote:However, please check if the attached patch fixes your problem.
Yes, it does. Thank you!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

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

#4 Post by Geoff the Medio »

committed

Post Reply