Compiling V0.4.10.1

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
Grummel7
Space Dragon
Posts: 335
Joined: Mon Oct 09, 2017 3:44 pm

Compiling V0.4.10.1

#1 Post by Grummel7 »

While building V0.4.10.1 I got the following from CMake:
CMake Warning (dev) at /usr/share/cmake-3.13/Modules/FindOpenGL.cmake:270 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

FindOpenGL found both a legacy GL library:

OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

and GLVND libraries for OpenGL and GLX:

OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
With "cmake_policy (SET CMP0072 OLD)" it compiled, but the this setting is said to be depricated.

With "cmake_policy (SET CMP0072 NEW)" I got:
[ 62%] Linking CXX executable freeorion
/usr/bin/ld: CMakeFiles/freeorion.dir/UI/SidePanel.cpp.o: undefined reference to symbol 'glMaterialfv'
/usr/bin/ld: //lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

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

Re: Compiling V0.4.10.1

#2 Post by Geoff the Medio »

Anvil wrote: Mon Jan 04, 2021 6:53 pm[ 62%] Linking CXX executable freeorion
/usr/bin/ld: CMakeFiles/freeorion.dir/UI/SidePanel.cpp.o: undefined reference to symbol 'glMaterialfv'
/usr/bin/ld: //lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Looks similar to: https://github.com/PaulStoffregen/MotionCal/issues/10

User avatar
Grummel7
Space Dragon
Posts: 335
Joined: Mon Oct 09, 2017 3:44 pm

Re: Compiling V0.4.10.1

#3 Post by Grummel7 »

I should have searched the compile forum first, same problem was reported in viewtopic.php?f=24&t=11729

Indeed after appending -lGL -lGLU to build/CMakeFiles/freeorion.dir/link.txt, it compiles also with cmake_policy (SET CMP0072 NEW).

Where to fix this in the code and whether it need to be fixed in freeorion of cmake I don't know. If it is important: I have libopengl0 version 1.1.0.

Post Reply