FreeOrion

Forums for the FreeOrion project
It is currently Fri Nov 24, 2017 12:11 am

All times are UTC




Post new topic Reply to topic  [ 60 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Compile Problem
PostPosted: Thu Jun 04, 2015 4:10 am 
Offline
Juggernaut

Joined: Mon Feb 04, 2013 10:15 pm
Posts: 757
Getting closer...

Just pulled down from git today.

Code:
[ 67%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/UniverseGenerator.cpp.o
/home/andrew/Games/freeorion/universe/UniverseGenerator.cpp:716:36: warning: ‘const {anonymous}::MonsterFleetPlanManager& {anonymous}::GetMonsterFleetPlanManager()’ defined but not used [-Wunused-function]
     const MonsterFleetPlanManager& GetMonsterFleetPlanManager()
                                    ^
Linking CXX executable ../freeoriond
../libfreeorioncommon.so: undefined reference to `FreeOrionVersionString()'
collect2: error: ld returned 1 exit status
server/CMakeFiles/freeoriond.dir/build.make:401: recipe for target 'freeoriond' failed
make[2]: *** [freeoriond] Error 1
CMakeFiles/Makefile2:309: recipe for target 'server/CMakeFiles/freeoriond.dir/all' failed
make[1]: *** [server/CMakeFiles/freeoriond.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2


Any idea where to look?


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 04, 2015 5:09 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4379
AndrewW wrote:
Any idea where to look?
If you search our forums (upper right of page) for FreeOrionVersionString, you'll find a thread with a couple potential fixes (the simplest has to do with changing the build location).

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Wed Jun 10, 2015 11:38 pm 
Offline
Juggernaut

Joined: Mon Feb 04, 2013 10:15 pm
Posts: 757
Got closer:

Code:
[100%] Building CXX object client/human/CMakeFiles/freeorion.dir/__/__/UI/TextBrowseWnd.cpp.o
Linking CXX executable ../../freeorion
CMakeFiles/freeorion.dir/chmain.cpp.o: In function `mainConfigOptionsSetup(std::vector<std::string, std::allocator<std::string> > const&)':
chmain.cpp:(.text+0xe4d): undefined reference to `FreeOrionVersionString()'
chmain.cpp:(.text+0x1781): undefined reference to `FreeOrionVersionString()'
CMakeFiles/freeorion.dir/chmain.cpp.o: In function `mainSetupAndRun()':
chmain.cpp:(.text+0x376f): undefined reference to `FreeOrionVersionString()'
CMakeFiles/freeorion.dir/__/__/UI/IntroScreen.cpp.o: In function `IntroScreen::IntroScreen()':
IntroScreen.cpp:(.text+0x359f): undefined reference to `FreeOrionVersionString()'
collect2: error: ld returned 1 exit status
client/human/CMakeFiles/freeorion.dir/build.make:1729: recipe for target 'freeorion' failed
make[2]: *** [freeorion] Error 1
CMakeFiles/Makefile2:413: recipe for target 'client/human/CMakeFiles/freeorion.dir/all' failed
make[1]: *** [client/human/CMakeFiles/freeorion.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 1:08 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4379
ok well can you tell us what potential fixes you tried from that other thread, and how your situation matches or not? What cmake version and boost versions are you using? Did you try an out-of-source build?

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 2:31 am 
Offline
Juggernaut

Joined: Mon Feb 04, 2013 10:15 pm
Posts: 757
Dilvish wrote:
ok well can you tell us what potential fixes you tried from that other thread, and how your situation matches or not? What cmake version and boost versions are you using? Did you try an out-of-source build?


Tried:

Code:
git clone https://github.com/freeorion/freeorion
mkdir freeorion.build
cd freeorion.build
cmake ../freeorion
make


cmake 3.0.2-1
libboost-all-d 1.55.0.2


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 5:49 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4379
Ah, yeah, I think I see the issue, your build directory is all the way out of your local git repo. When we had been using the phrase "out-of-source" build, it really meant something more like "compartmentalized from the source files" not "totally out of the source tree". Try
Code:
git clone https://github.com/freeorion/freeorion
cd freeorion
mkdir build
cd build
cmake ..
make

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 8:03 am 
Offline
Juggernaut

Joined: Mon Feb 04, 2013 10:15 pm
Posts: 757
Dilvish wrote:
Ah, yeah, I think I see the issue, your build directory is all the way out of your local git repo. When we had been using the phrase "out-of-source" build, it really meant something more like "compartmentalized from the source files" not "totally out of the source tree". Try
Code:
git clone https://github.com/freeorion/freeorion
cd freeorion
mkdir build
cd build
cmake ..
make


Ok, that plus a link worked.


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 9:50 am 
Offline
Pupating Mass

Joined: Fri Mar 15, 2013 12:54 pm
Posts: 96
Don't put the build dir inside the git source tree! Put it outside at the same level as the source tree, to prevent a build bug.

on a generic linux, I was able to build like this:
Quote:
git clone https://github.com/freeorion/freeorion.git
mkdir freeorion.build
cd freeorion.build
cmake ../freeorion
make -j2
ln -s ../freeorion/default/ .
./freeorion


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 4:03 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4379
pheldens wrote:
Don't put the build dir inside the git source tree! Put it outside at the same level as the source tree, to prevent a build bug.
The location I suggested is the default for KDevelop, and has never caused me any trouble (though it is best to then add that add it to .gitignore). The location you suggest appears to me to be the exact one that had been causing AndrewW trouble.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 4:55 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3268
OK, the Compile in Linux wiki page still contains references to Bullet and Ogre3d that need removing. It needs adding that you need SDL2 and not 1.2 (which comes with Kubuntu), so
Code:
sudo apt-get install libsdl2-dev
will grab that.

Now I can't get it to install because it wants me to have Glew. I've downloaded Glew, but can't figure out how to get it into the right place, so I'm taking a break, if anyone knows, brilliant, I'll get on with it when I've watered the garden

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 5:13 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4379
MatGB wrote:
OK, the Compile in Linux wiki page still contains references to Bullet and Ogre3d that need removing. It needs adding that you need SDL2 and not 1.2 (which comes with Kubuntu), so
Code:
sudo apt-get install libsdl2-dev
will grab that.
Now I can't get it to install because it wants me to have Glew. I've downloaded Glew, but can't figure out how to get it into the right place, so I'm taking a break, if anyone knows, brilliant, I'll get on with it when I've watered the garden

Code:
sudo apt-get install libglew-dev
should do it; I didn't do anything fancy for my install of it.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 5:42 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3268
Building! Excellent. I'll get used to this command line thing, eventually.

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 5:58 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3268
OK, 72% in very quickly, then this
Code:
Linking CXX executable ../freeoriond
../libfreeorioncommon.so: undefined reference to `FreeOrionVersionString()'
collect2: error: ld returned 1 exit status
make[2]: *** [freeoriond] Error 1
make[1]: *** [server/CMakeFiles/freeoriond.dir/all] Error 2
make: *** [all] Error 2
matgb@MatGB-Desktop:~/git/freeorion/build$

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 6:28 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4379
right, there have been a lot of people running into that; it's why I just added to the compile instructions a recommendation to make a separate build directory. Instead of running cmake and make from within the main freeorion directory, make a build directory (then you also have to add a link to the content directory). if you add it within the freeorion directory you'd want to add it to your .gitignore, but some some folks (but not all it seems) it works to add it outside the freeorion directory. That's probably best to try first. So if you had the source at programs/freeorion, then you would
cd programs
mkdir freeorion.build
cd freeorion.build
ln -s ../freeorion/default .
cmake ../freeorion
make

when you update only the "make" step normally needs to be redone

If you still have trouble with VersionString, then do the same as above but make the build directory be within the freeorion directory (and then the cmake step would be "cmake .." and the link step would be "ln -s ../default ."

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: Compile Problem
PostPosted: Thu Jun 11, 2015 6:32 pm 
Offline
Juggernaut

Joined: Mon Feb 04, 2013 10:15 pm
Posts: 757
Also you might want to add "-jx" to the make command if you have multiple cores and/or CPU's, replace the x with the number of cores or number of cores+1. This can speed up compiling by using multiple threads, so say if you have a quad core it would look like:

Code:
make -j5


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 60 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group