Compiled it but cant't start game

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
drkosy
Space Squid
Posts: 78
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

[[email protected]]$ ./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 :?:

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12772
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 Squid
Posts: 78
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...

User avatar
adrian_broher
Programmer
Posts: 1155
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 Squid
Posts: 78
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 :)

User avatar
Oberlus
Cosmic Dragon
Posts: 3051
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 Squid
Posts: 78
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+

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12772
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 Squid
Posts: 78
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 :)

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12772
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 Squid
Posts: 78
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 7 times

Post Reply