linking freeorion

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
fit81
Space Krill
Posts: 4
Joined: Thu Sep 01, 2011 10:15 pm

linking freeorion

#1 Post by fit81 »

Hi,

compiling the freeorion rv4217 i get the next error :


/usr/bin/ld: CMakeFiles/freeorion.dir/__/__/UI/CUIControls.cpp.o: undefined reference to symbol 'glTranslated'
/usr/bin/ld: note: 'glTranslated' is defined in DSO /usr/lib/libGL.so.1 so try adding it to the linker command line
/usr/lib/libGL.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [freeorion] Error 1
make[1]: *** [client/human/CMakeFiles/freeorion.dir/all] Error 2
make: *** [all] Error 2

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

Re: linking freeorion

#2 Post by Geoff the Medio »

Looks like you need to add -lGL to the linker command. Presumably there's a way to do that through CMake or editing the make file...

fit81
Space Krill
Posts: 4
Joined: Thu Sep 01, 2011 10:15 pm

Re: linking freeorion

#3 Post by fit81 »

I added in various make files the -lGL command and doesn't work.

when i do a cmake . this is the result :

The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Build platform: linux
-- Boost version: 1.46.1
-- Found the following Boost libraries:
-- date_time
-- filesystem
-- serialization
-- signals
-- system
-- thread
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.3.4")
-- checking for module 'GiGi'
-- found GiGi, version 0.8.0
-- Found Subversion: /usr/bin/svn (found version "1.6.17")
-- Configuring freeoriond
-- Configuring freeorionca
-- Boost version: 1.46.1
-- Found the following Boost libraries:
-- date_time
-- filesystem
-- serialization
-- signals
-- system
-- thread
-- iostreams
-- python
-- Found PythonLibs: /usr/lib/libpython2.6.so
-- Configuring freeorion
-- Found OpenAL: /usr/lib/libopenal.so
-- Found ALUT: /usr/lib/libalut.so
-- checking for one of the modules 'OGRE'
-- libraries : OgreMain;pthread from /usr/lib
-- includes : /usr/include/OGRE
-- Found Ogg: /usr/lib/libogg.so
-- Found Vorbis: /usr/lib/libvorbis.so
-- libraries : /usr/local/lib/libBulletDynamics.so;/usr/local/lib/libBulletCollision.so;/usr/local/lib/libLinearMath.so from
-- includes : /usr/local/include/bullet
-- Configuring done
-- Generating done

Its OK?

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

Re: linking freeorion

#4 Post by Geoff the Medio »

If you rerun cmake after editing make files, it may have overwritten them...

Did adding the -lGL change the resulting calls to the linker? How did it not work?

fit81
Space Krill
Posts: 4
Joined: Thu Sep 01, 2011 10:15 pm

Re: linking freeorion

#5 Post by fit81 »

I know if you run cmake the make files are overwritten , i don't know what make files i have to add the -lGL. I added to one that doesn't work but there are many make files.

Sorry if I my explanation is so bad but my english is very bad, he he he.

Thank very much for your responses.

fit81
Space Krill
Posts: 4
Joined: Thu Sep 01, 2011 10:15 pm

Re: linking freeorion

#6 Post by fit81 »

The solution is in the CMakeCache.txt :

CMAKE_CXX_FLAGS:STRING=-lGL <-- added

I don't know why the cmake dont add this field automatically.

Thank you very much for the response.

Beagle2
Space Krill
Posts: 1
Joined: Wed Dec 07, 2011 4:48 pm

Re: linking freeorion

#7 Post by Beagle2 »

Hello!

I get a similar error during compile:

Linking CXX executable ../../freeorion
/usr/bin/ld: CMakeFiles/freeorion.dir/__/__/UI/SidePanel.cpp.o: undefined reference to symbol 'gluQuadricTexture'
/usr/bin/ld: note: 'gluQuadricTexture' is defined in DSO /usr/lib64/libGLU.so.1 so try adding it to the linker command line
/usr/lib64/libGLU.so.1: could not read symbols: Invalid operation
collect2: ld gab 1 als Ende-Status zurück
make[2]: *** [freeorion] Fehler 1
make[1]: *** [client/human/CMakeFiles/freeorion.dir/all] Fehler 2
make: *** [all] Fehler 2

I ran cmake with the options -DCMAKE_CXX_FLAGS:STRING=-IGL, but the same error appeared. I also tried the option -IGLU, and both together -IGL -IGLU. Neither of this options changed anything, any idea what to do about it?

Thanks in advance.

muuus
Space Krill
Posts: 9
Joined: Sat Dec 03, 2011 5:34 pm
Location: Russia, Moscow

Re: linking freeorion

#8 Post by muuus »

Probably same here:

Code: Select all

[ 99%] Building CXX object client/human/CMakeFiles/freeorion.dir/__/__/util/AppInterface.cpp.o
[100%] Building CXX object client/human/CMakeFiles/freeorion.dir/__/__/util/VarText.cpp.o
Linking CXX executable ../../freeorion
/usr/bin/ld: CMakeFiles/freeorion.dir/__/__/UI/SidePanel.cpp.o: undefined reference to symbol 'gluQuadricOrientation'
/usr/bin/ld: note: 'gluQuadricOrientation' is defined in DSO /usr/lib/libGLU.so.1 so try adding it to the linker command line
/usr/lib/libGLU.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [freeorion] Error 1
make[1]: *** [client/human/CMakeFiles/freeorion.dir/all] Error 2
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
How can i link libGLU.so.1?

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

Re: linking freeorion

#9 Post by Geoff the Medio »

muuus wrote:How can i link libGLU.so.1?
Did you try the methods suggested earlier in this thread?

Post Reply