Compiled it but cant't start game

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Compiled it but cant't start game

#1 Post by drkosy »

After some hours of installing packiges, reading error logs and guides I finally did it to start building the game. It run smoothly till 100% and ended with the following:

Code: Select all

[100%] Building CXX object CMakeFiles/freeorion.dir/util/DependencyVersions.cpp.o
[100%] Linking CXX executable freeorion
/usr/bin/ld: CMakeFiles/freeorion.dir/UI/SidePanel.cpp.o: undefined reference to symbol 'glMaterialfv'
/usr/bin/ld: /usr/lib64/libGL.so.1: error adding symbols: DSO missing from command line
collect2: Fehler: ld gab 1 als Ende-Status zurück
make[2]: *** [CMakeFiles/freeorion.dir/build.make:1116: freeorion] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:740: CMakeFiles/freeorion.dir/all] Fehler 2
make: *** [Makefile:172: all] Fehler 2
I do not have a glue what that means. :oops:
At least I ended up with the executable file "freeorionca" and "freeoriond" but there is no "freeorion" :| If I start freeoriond nothing visible is happening but if I cancel the job it tells me:

Code: Select all

[me@mypc]$ ./freeoriond
^C[2020-07-25 18:41:50.436005] [0x00007f9254198780] [info]    ServerApp::~ServerApp
[2020-07-25 18:41:50.436037] [0x00007f9254198780] [info]    Server exited cleanly.
[2020-07-25 18:41:50.436130] [0x00007f9254198780] [info]    Reset id allocators with highest object id = -1 and highest design id = -1
Don't really know what that should mean :oops:
Maybe you could give me some hints what went wrong :?:
Want some fresh experience? Try Kosymod

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

Re: Compiled it but cant't start game

#2 Post by Geoff the Medio »

The code compiled OK, but there was an error in the linking stage of the client with the OpenGL function glMaterialfv and consequently there is no freeorion binary available. Running just the server, freeoriond, won't do much of interest.

A quick workaround might be to comment out the lines in SidePanel.cpp that use glMaterialfv by prepending //

Googling "undefined reference to symbol 'glMaterialfv'" also returns various results, but most of those seem to be able telling the linker to link against the GL library, but that appears to already be happening, and if it wasn't, it would have lead to many other errors.

What version of OpenGL does your system support?

User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Re: Compiled it but cant't start game

#3 Post by drkosy »

Thanks for the quick answer :D
Aktually I found the problem by some reading in the forum. I added that line to CMakeList.txt to avoid an error message.

Code: Select all

cmake_policy(SET CMP0072 NEW)
But somewhere I read, that FO at the moment don't run on GLVND so I changed it to

Code: Select all

cmake_policy(SET CMP0072 OLD)
That fixed the error message and the problem :D

By the way: I hat two strange warnings about file-checks. In freeorion/check/CMakeLists.txt the two packages "CPPCheck" and "PYCodestyle" where written like here (starting with upper case) but in freeorion/cmake/FindCPPCheck.cmake , freeorion/cmake/FindPYCodestyle.cmake respectively it's written all in lower case

Code: Select all

NAMES cppcheck
I fixed that warning by changing the upper case letters in lower case at /check/CMakeLists.txt and than rename the files at /cmake to be all in lower case.
That's not a big thing, but as newby in building it confused me a bit...
Want some fresh experience? Try Kosymod

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

Re: Compiled it but cant't start game

#4 Post by adrian_broher »

> At least I ended up with the executable file "freeorionca" and "freeoriond" but there is no "freeorion" :| If I start freeoriond nothing visible is happening but if I cancel the job it tells me:

freeorionca (freeorion client AI) is the binary, which is run for AI players.
freeoriond (freeorion daemon) is the freeorion server.
freeorion is the actual graphical game intended for users.

> It run smoothly till 100% and ended with the following:

Please try running `make VERBOSE=1` instead of just `make` to obtain more information about the linking step.

> I do not have a glue what that means. :oops:

The Linker creates the final binary from intermediate files and checks if each function that is called within the application or against the operating system application programming interface (API) can be found. For some reason your system doesn't expose the `glMaterialfv` function of the OpenGL API or the linker cannot find it for some other reason (undefined reference to symbol).
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Re: Compiled it but cant't start game

#5 Post by drkosy »

Thanks for that explanations :D
That error actually came form OpenGL, because I forced make to use GLVND with a policy change that caused the problem. I removed that and got the "freeorion" file.
Now I successfully compiled freeorion on my laptop :)
But today I tried it on my desktop machine. It compiled without errors and I got the "freeorion" file beside all other files. I can play the game as usual. The only BIG problem is, I can't load savegames. Actually I can load them but the universe is empty. No player inside, not the human player nor any AI players.
While compiling I got strange messages, but no errors. Those read like this:

Code: Select all

[ 92%] Building CXX object CMakeFiles/freeorion.dir/UI/PopulationPanel.cpp.o
In Datei, eingebunden von /home/peter/Hobby/Spiele/FreeOrion/build/freeorion/UI/CUISpin.h:8,
                 von /home/peter/Hobby/Spiele/FreeOrion/build/freeorion/UI/OptionsWnd.cpp:10:
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h: In Instanziierung von »void GG::Spin<T>::CompleteConstruction() [mit T = int]«:
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/UI/CUISpin.h:33:42:   erfordert durch »void CUISpin<T>::CompleteConstruction() [mit T = int]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Wnd.h:363:34:   erfordert durch »static std::shared_ptr<_Tp> GG::Wnd::Create(Args&& ...) [mit T = CUISpin<int>; Args = {int&, int, const int&, const int&, bool}]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/UI/OptionsWnd.cpp:940:110:   von hier erfordert
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h:186:17: Warnung: Variable »style« wird nicht verwendet [-Wunused-variable]
  186 |     const auto& style = GetStyleFactory();
      |                 ^~~~~
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h: In Instanziierung von »void GG::Spin<T>::CompleteConstruction() [mit T = double]«:
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/UI/CUISpin.h:33:42:   erfordert durch »void CUISpin<T>::CompleteConstruction() [mit T = double]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Wnd.h:363:34:   erfordert durch »static std::shared_ptr<_Tp> GG::Wnd::Create(Args&& ...) [mit T = CUISpin<double>; Args = {double&, int, const double&, const double&, bool}]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/UI/OptionsWnd.cpp:977:113:   von hier erfordert
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h:186:17: Warnung: Variable »style« wird nicht verwendet [-Wunused-variable]
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h: In Instanziierung von »void GG::Spin<T>::ValueUpdated(const string&) [mit T = int; std::string = std::__cxx11::basic_string<char>]«:
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h:433:51:   erfordert durch »void GG::Spin<T>::ConnectSignals() [mit T = int]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h:193:5:   erfordert durch »void GG::Spin<T>::CompleteConstruction() [mit T = int]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/UI/CUISpin.h:33:42:   erfordert durch »void CUISpin<T>::CompleteConstruction() [mit T = int]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Wnd.h:363:34:   erfordert durch »static std::shared_ptr<_Tp> GG::Wnd::Create(Args&& ...) [mit T = CUISpin<int>; Args = {int&, int, const int&, const int&, bool}]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/UI/OptionsWnd.cpp:940:110:   von hier erfordert
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h:444:21: Warnung: polymorpher Typ »class boost::bad_lexical_cast« wird per Wertzuweisung gefangen [-Wcatch-value=]
  444 |     } catch (boost::bad_lexical_cast) {
      |                     ^~~~~~~~~~~~~~~~
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h: In Instanziierung von »void GG::Spin<T>::ValueUpdated(const string&) [mit T = double; std::string = std::__cxx11::basic_string<char>]«:
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h:433:51:   erfordert durch »void GG::Spin<T>::ConnectSignals() [mit T = double]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h:193:5:   erfordert durch »void GG::Spin<T>::CompleteConstruction() [mit T = double]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/UI/CUISpin.h:33:42:   erfordert durch »void CUISpin<T>::CompleteConstruction() [mit T = double]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Wnd.h:363:34:   erfordert durch »static std::shared_ptr<_Tp> GG::Wnd::Create(Args&& ...) [mit T = CUISpin<double>; Args = {double&, int, const double&, const double&, bool}]«
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/UI/OptionsWnd.cpp:977:113:   von hier erfordert
/home/peter/Hobby/Spiele/FreeOrion/build/freeorion/GG/GG/Spin.h:444:21: Warnung: polymorpher Typ »class boost::bad_lexical_cast« wird per Wertzuweisung gefangen [-Wcatch-value=]
[ 92%] Building CXX object CMakeFiles/freeorion.dir/UI/ProductionWnd.cpp.o
I wonder because both machines run with fedora32 with kde and the same packages installed. If you need more information I gladly will provide them :)
Want some fresh experience? Try Kosymod

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Compiled it but cant't start game

#6 Post by Oberlus »

Are the save files from the same freoorion version? Sometimes old save files aren't compatible.

User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Re: Compiled it but cant't start game

#7 Post by drkosy »

Yes, they are from the same version. For the old version I use snap that keeps the save games elsewhere.
Actually I get closer to the problem. I took and closer look at the game and found that it must be a test version because there are strange things like IP (influence points) and policy slots. :shock:
I check cmake configuration but the build type was set to "Release". Exactly as it was for my laptop. Maybe there were any changes made on git? Or did I simply miss anything :?:

P.S: Just checked version. It's v 0.4.10+
Want some fresh experience? Try Kosymod

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

Re: Compiled it but cant't start game

#8 Post by Geoff the Medio »

drkosy wrote: Sun Jul 26, 2020 9:50 pmI check cmake configuration but the build type was set to "Release".
You're building the test / dev code in release mode, not the release version v0.4.10 of FreeOrion. The CMake "release" configuration has to do with *how* you build (link against non-debug library versions) not *what* you build, which in this case is the development master branch, not the tagged v0.4.10 release branch. You need to check out the appropriate release branch and build that if you want the release version.

Master v0.4.10+ plausibly can't load release v0.4.10 save files, if that's what you're trying.

User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Re: Compiled it but cant't start game

#9 Post by drkosy »

Thanks a lot for your help :D I'm just learning to work with git and cmake so with your help maybe I get expert soon :wink:
Aktually I played version 0.4.10+ did a small mistake and tried to reload an autosave game. It went strange because I could load but without any players. Not the human player nor the AI players. Maybe something is broken there...

For me that doesn't matter because I like to play the v0.4.10 witch runs nicely on my laptop :)
Want some fresh experience? Try Kosymod

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

Re: Compiled it but cant't start game

#10 Post by Geoff the Medio »

drkosy wrote: Mon Jul 27, 2020 7:50 am[... I] tried to reload an autosave game. It went strange because I could load but without any players. Not the human player nor the AI players. Maybe something is broken there...
Please post the save file.

User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Re: Compiled it but cant't start game

#11 Post by drkosy »

Here you go :)
There are two files inside:
1.) FreeOrion_Cyberplant_Flowerpower... -> The original save
2.) FreeOrion_Beobachter... -> The autosave as I left the empty game
Please let me know if you need any logfiles...
Attachments
autosave.zip
(397.34 KiB) Downloaded 117 times
Want some fresh experience? Try Kosymod

User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Re: Compiled it but cant't start game

#12 Post by drkosy »

Today I can't run FO anymore on my laptop, so I decided to make a fresh compile of v0.4.10.1
cmake runs smoothly, but while compiling two errors occur:

Code: Select all

/usr/bin/ld: /usr/lib64/libboost_python39.so: undefined reference to `PyCMethod_New'
/usr/bin/ld: /usr/lib64/libboost_python39.so: undefined reference to `_Py_NewReference'
collect2: Fehler: ld gab 1 als Ende-Status zurück
make[2]: *** [CMakeFiles/freeoriond.dir/build.make:344: freeoriond] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:744: CMakeFiles/freeoriond.dir/all] Fehler 2
They doesn't appear at the last build process a few month ago and they break the server. I can start the game, create a new game but always get a server timeout error. Does anyone here have a clue what could went wrong?

P.S: Compiled on fedora 33 with gcc 10.2.1, boost 1.73 and python 3.9.2 - let me know if you need more details
Want some fresh experience? Try Kosymod

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

Re: Compiled it but cant't start game

#13 Post by Geoff the Medio »

This looks similar, though not immediately helpful: https://bugs.debian.org/cgi-bin/bugrepo ... bug=973104

Can you build against any older versions of Boost Python and Python?

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Compiled it but cant't start game

#14 Post by o01eg »

It looks like it misses link to python library or has it wrong order. Could you rebuild it with VERBOSE=1 to see full command-line arguments?
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Re: Compiled it but cant't start game

#15 Post by drkosy »

Can you build against any older versions of Boost Python and Python?
Sorry, there is no older version of boost in the repositories. Usually you have one legacy version, but for boost it's 1.73 too.
It looks like it misses link to python library or has it wrong order. Could you rebuild it with VERBOSE=1 to see full command-line arguments?
Here you are with that buggi part:

Code: Select all

/usr/bin/cmake -E cmake_link_script CMakeFiles/freeorionca.dir/link.txt --verbose=1
/usr/bin/ccache /usr/lib64/ccache/c++ -O2 -DNDEBUG CMakeFiles/freeorionca.dir/client/AI/AIClientApp.cpp.o CMakeFiles/freeorionca.dir/client/AI/AIFramework.cpp.o CMakeFiles/freeorionca.dir/client/AI/AIWrapper.cpp.o CMakeFiles/freeorionca.dir/client/AI/camain.cpp.o CMakeFiles/freeorionca.dir/client/ClientApp.cpp.o CMakeFiles/freeorionca.dir/client/ClientFSMEvents.cpp.o CMakeFiles/freeorionca.dir/client/ClientNetworking.cpp.o CMakeFiles/freeorionca.dir/combat/CombatSystem.cpp.o CMakeFiles/freeorionca.dir/python/CommonFramework.cpp.o CMakeFiles/freeorionca.dir/python/ConfigWrapper.cpp.o CMakeFiles/freeorionca.dir/python/EmpireWrapper.cpp.o CMakeFiles/freeorionca.dir/python/EnumWrapper.cpp.o CMakeFiles/freeorionca.dir/python/LoggingWrapper.cpp.o CMakeFiles/freeorionca.dir/python/UniverseWrapper.cpp.o CMakeFiles/freeorionca.dir/util/DependencyVersions.cpp.o -o freeorionca  -Wl,-rpath,/home/peter/Hobby/Spiele/FreeOrion/build/v0-4-10-1: libfreeorioncommon.so libfreeorionparse.so /usr/lib64/libboost_python39.so /usr/lib64/libpython3.6m.so /usr/lib64/libboost_iostreams.so /usr/lib64/libboost_locale.so /usr/lib64/libboost_log.so /usr/lib64/libboost_filesystem.so /usr/lib64/libboost_regex.so /usr/lib64/libboost_log_setup.so /usr/lib64/libboost_thread.so /usr/lib64/libboost_date_time.so /usr/lib64/libboost_chrono.so /usr/lib64/libboost_atomic.so -lpthread /usr/lib64/libboost_serialization.so /usr/lib64/libz.so 
/usr/bin/ld: /usr/lib64/libboost_python39.so: undefined reference to `PyCMethod_New'
/usr/bin/ld: /usr/lib64/libboost_python39.so: undefined reference to `_Py_NewReference'
collect2: Fehler: ld gab 1 als Ende-Status zurück
make[2]: *** [CMakeFiles/freeorionca.dir/build.make:329: freeorionca] Fehler 1
make[2]: Verzeichnis „/home/peter/Hobby/Spiele/FreeOrion/build/v0-4-10-1“ wird verlassen
make[1]: *** [CMakeFiles/Makefile2:687: CMakeFiles/freeorionca.dir/all] Fehler 2
make[1]: Verzeichnis „/home/peter/Hobby/Spiele/FreeOrion/build/v0-4-10-1“ wird verlassen
make: *** [Makefile:171: all] Fehler 2
Edit: Cmake gives me some warnings like:

Code: Select all

CMake Warning at cmake/FindBoost.cmake:911 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1033 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1723 (_Boost_MISSING_DEPENDENCIES)
  GG/CMakeLists.txt:79 (find_package)
I ignored them, because they already were there the last time I compiled and it went through smoothly. Maybe there are problems with newer versions of boost or python...
Want some fresh experience? Try Kosymod

Post Reply