Problems Compiling freeorion (from svn)

Questions, problems and discussion about compiling FreeOrion.

Moderators: Oberlus, Oberlus

Message
Author
tedbronson
Space Krill
Posts: 9
Joined: Mon Aug 06, 2007 10:51 pm

Problems Compiling freeorion (from svn)

#1 Post by tedbronson » Tue Aug 07, 2007 2:19 am

Ok after looking thru the forums I was able to get all the way to the point where it actually started building freeorion....unfortunately, this is what I got:

Code: Select all

g++ -o UI/TechTreeWnd-human.o -c -pthread -Wall -O2 -DFREEORION_LINUX -DENABLE_BINRELOC -DFREEORION_BUILD_HUMAN -I/usr/include/python2.4 -I/usr/local/include/boost-1_34_1 -I/usr/local/include -I/usr/include/graphviz -Inetwork UI/TechTreeWnd.cpp
UI/TechTreeWnd.cpp: In function 'void<unnamed>::FillTheoryPanel(const GG::Rect&, int)':
UI/TechTreeWnd.cpp:99: error: 'PI' was not declared in this scope
UI/TechTreeWnd.cpp: In function 'void<unnamed>::FillApplicationPanel(const GG::Rect&, int)':
UI/TechTreeWnd.cpp:129: error: 'PI' was not declared in this scope
UI/TechTreeWnd.cpp: In function 'void<unnamed>::TraceTechPanelOutline(TechType, const GG::Rect&, const GG::Rect&, bool)':
UI/TechTreeWnd.cpp:214: error: 'PI' was not declared in this scope
UI/TechTreeWnd.cpp:238: error: 'PI' was not declared in this scope
UI/TechTreeWnd.cpp:255: error: 'PI' was not declared in this scope
UI/TechTreeWnd.cpp:273: error: 'PI' was not declared in this scope
UI/TechTreeWnd.cpp: In member function 'virtual void TechTreeWnd::TechNavigator::SectionHeaderControl::Render()':
UI/TechTreeWnd.cpp:1051: error: 'PI' was not declared in this scope
UI/TechTreeWnd.cpp: In member function 'void TechTreeWnd::LayoutPanel::Layout(bool, double)':
UI/TechTreeWnd.cpp:1845: error: 'PS2INCH' was not declared in this scope
UI/TechTreeWnd.cpp:1875: error: 'PS2INCH' was not declared in this scope
UI/TechTreeWnd.cpp: At global scope:
UI/TechTreeWnd.cpp:31: warning: '<unnamed>::temp_bool' defined but not used
scons: *** [UI/TechTreeWnd-human.o] Error 1
scons: building terminated because of errors.
the command I used was:

Code: Select all

scons with_boost_include=/usr/local/include/boost-1_34_1 with_boost_libdir=/usr/local/lib boost_lib_suffix=-gcc41-mt-d-1_34_1 with_graphviz_include=/usr/include/graphviz with_graphviz_libdir=/usr/lib/graphviz with_openal_libdir=/usr/local/lib
If anyone has any ideas/suggestions, I'd love to hear them.

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

Re: Problems Compiling freeorion (from svn)

#2 Post by Geoff the Medio » Tue Aug 07, 2007 2:34 am

PI should be defined in arith.h that is part of graphviz. The include chain for me is gvc.h -> types.h -> geom.h -> arith.h

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Problems Compiling freeorion (from svn)

#3 Post by kroddn » Tue Aug 07, 2007 8:52 am

Did you run scons and scons install in the GG subdir after updating?

tedbronson
Space Krill
Posts: 9
Joined: Mon Aug 06, 2007 10:51 pm

Re: Problems Compiling freeorion (from svn)

#4 Post by tedbronson » Tue Aug 07, 2007 4:28 pm

hmmm arith.h isnt in my include directory for graphviz :-(
there is an arith.hpp in my boost directory tho
as for the other reply, yes I did both scons and scons install for Gigi

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Problems Compiling freeorion (from svn)

#5 Post by loonycyborg » Tue Aug 07, 2007 4:47 pm

What is the version of your graphviz? FreeOrion requires graphviz version 2.8.

SCons script should enforce graphviz version, but only pkg-config based check does this. If pkg-config check fails, scons script falls back to non-pkg-config check which does not enforce version.
In Soviet Russia, forum posts YOU!!

tedbronson
Space Krill
Posts: 9
Joined: Mon Aug 06, 2007 10:51 pm

Re: Problems Compiling freeorion (from svn)

#6 Post by tedbronson » Tue Aug 07, 2007 5:58 pm

maybe thats the problem, the only version of graphviz I could find was 2.15

I did find arith.h in the sources and tried copying it into the proper directory, but no luck yet.

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Problems Compiling freeorion (from svn)

#7 Post by loonycyborg » Tue Aug 07, 2007 6:33 pm

2.15 is newer version than 2.8. In fact, 2.15 is latest development snapshot.

You should install graphviz version 2.8 or later either using package management utility of your distribution or from sources with "./configure && make && make install".
In Soviet Russia, forum posts YOU!!

tedbronson
Space Krill
Posts: 9
Joined: Mon Aug 06, 2007 10:51 pm

Re: Problems Compiling freeorion (from svn)

#8 Post by tedbronson » Tue Aug 07, 2007 6:50 pm

Okay, i have been doing "./configure" then "make install clean" to build from sources, I'll see if anything different happens this time.

tedbronson
Space Krill
Posts: 9
Joined: Mon Aug 06, 2007 10:51 pm

Re: Problems Compiling freeorion (from svn)

#9 Post by tedbronson » Tue Aug 07, 2007 7:20 pm

Nope no luck doing it either thru .configure && make && make install or by using rpm. Still getting the same error, even after completly deleting the freeorion dir and rechecking it out from svn.

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Problems Compiling freeorion (from svn)

#10 Post by loonycyborg » Tue Aug 07, 2007 7:41 pm

"make install" installs graphviz into /usr/local. You can specify its location with command-line options to scons:

Code: Select all

scons with_graphviz_include=/usr/local/include/graphviz with_graphviz_libdir=/usr/local/lib
In Soviet Russia, forum posts YOU!!

tedbronson
Space Krill
Posts: 9
Joined: Mon Aug 06, 2007 10:51 pm

Re: Problems Compiling freeorion (from svn)

#11 Post by tedbronson » Tue Aug 07, 2007 8:34 pm

I already put those in, else it wouldn't find gvc.h......

further, by looking in arith.h I can see that PI is simply defined as, of course, pi or 3.14159265...
I manually put it into the file, problem solved. BUT I still have no clue where or what PS2INCH comes from :-(

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

Re: Problems Compiling freeorion (from svn)

#12 Post by Geoff the Medio » Tue Aug 07, 2007 8:51 pm

tedbronson wrote:I manually put [definition of PI] into the file, problem solved.
You put it into what file?

It might get rid of that build error, but I doubt it will solve your problems...
BUT I still have no clue where or what PS2INCH comes from :-(
You could grep for it.

However, for me it's in geom.h

Code: Select all

#define POINTS_PER_INCH	72
#define POINTS(f_inch)	(ROUND((f_inch)*POINTS_PER_INCH))
#define PS2INCH(ps)		((ps)/(double)POINTS_PER_INCH)

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Problems Compiling freeorion (from svn)

#13 Post by loonycyborg » Tue Aug 07, 2007 9:01 pm

tedbronson, did "make install" install arith.h into /usr/local/include/graphviz or some other subdirectory of /usr/local?
In Soviet Russia, forum posts YOU!!

tedbronson
Space Krill
Posts: 9
Joined: Mon Aug 06, 2007 10:51 pm

Re: Problems Compiling freeorion (from svn)

#14 Post by tedbronson » Tue Aug 07, 2007 11:46 pm

no arith.h is nowhere to be found. did a "find | grep arith.h" in / and the only result was from the expanded tarball.
I tried copying the header from there into the directory with the rest of the graphviz files but it still didn't see it.

geom.h IS in the directory, and also must not be working properly, because it gives the same error for PS2INCH

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Problems Compiling freeorion (from svn)

#15 Post by loonycyborg » Wed Aug 08, 2007 5:39 am

tedbronson wrote:"find | grep arith.h" in /
I bet this has taken long time. slocate is much faster.

Were there any errors when compiling graphviz with "configure && make && make install"?
In Soviet Russia, forum posts YOU!!

Post Reply