TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
Magneus
Space Krill
Posts: 5
Joined: Tue Mar 10, 2009 11:16 pm
Location: Central NJ, USA

TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#1 Post by Magneus »

Forgive me if this has been covered, but my problem seems to be slightly different from others I've seen.

My System

OS: Gentoo Linux AMD64
GCC: 4.3.3
Boost: 1.37.0
Ogre: 1.6.1
Scons: 1.2.0-r1
Python: 2.5.4-r2
GraphViz: 2.22.1
Devil: 1.7.7

And yes, I did a COMPLETE system recompile (and revdep-rebuild) to ensure that my upgrade from GCC 4.1 to 4.3 didn't leave any packages out in the cold.

The Problem

Upon compiling FreeOrion, I receive the following error:

Code: Select all

UI/TechTreeWnd.cpp: In member function 'void TechTreeWnd::LayoutPanel::Layout(bool, double)':
UI/TechTreeWnd.cpp:1691: error: 'ND_coord_i' was not declared in this scope
I don't know C++, so pardon me if my interpretation of this is wrong, but it appears that ND_coord_i is a function call that perhaps comes from a library (GraphViz?), that has not been imported correctly, so the compiler sees "ND_coord_i" as (a variable) not yet declared. Is this roughly accurate?

FYI, I have already added the two extra includes at the top of TechTreeWnd.cpp, as recommended by another post about TechTreeWnd.cpp. These changes shown below:

Code: Select all

--- UI/TechTreeWnd.cpp  (revision 2918)
+++ UI/TechTreeWnd.cpp  (working copy)
@@ -21,6 +21,8 @@
 #include <gvc.h>
 #include <boost/format.hpp>
 #include <algorithm>
+#include <geom.h>
+#include <arith.h>
I've heard that GraphViz and AMD64 don't play nice, which I why I thought it may be a GraphViz call, but I haven't yet found the GraphViz API to verify.

Scons configure seems to work fine, and config.log looks good from what I can tell (no obvious failures).

Anyone have some advice for me? I'd love to compile this game! Thanks in advance.

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

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#2 Post by Geoff the Medio »

Is there a function called ND_coord (without _i) defined? If so, you might try replacing all instances of ND_coord_I with ND_coord, based on a similar change done in a random patch listing I found by googling. Basically a guess / stab in the dark, but perhaps worth trying...

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#3 Post by OndrejR »

Your graphviz version is 2.22 and my is 2.20 and I don't have problem on amd64 Debian. Can you downgrade?

Magneus
Space Krill
Posts: 5
Joined: Tue Mar 10, 2009 11:16 pm
Location: Central NJ, USA

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#4 Post by Magneus »

OndrejR,

You were right on the money! I rolled back and everything compiled. Looks like the Graphviz guys don't mind breaking backwards compatibility!

Unfortunately, I'm now getting a runtime error for the freeorion executable. Apparently FreeOrion isn't aware of where GiGi installed to. I'm getting the following error:

Code: Select all

/freeorion: error while loading shared libraries: libGiGiOgre.so: cannot open shared object file: No such file or directory
I'll look around and see if I can figure something out. I imagine recompiling using with_GiGi_include, or something along those lines, will solve the problem?

Magneus
Space Krill
Posts: 5
Joined: Tue Mar 10, 2009 11:16 pm
Location: Central NJ, USA

RenderSystem_GL

#5 Post by Magneus »

Solved that problem by copying the GG .so files to /usr/lib.

However, I'm now getting another runtime error on freeorion:

Code: Select all

main() caught exception(std::exception): OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library ./RenderSystem_GL.  System Error: ./RenderSystem_GL.so: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 80)
Ah ha! It's because my RenderSystem_GL is located in /usr/lib64/OGRE. Should I symlink it from /usr/include/OGRE, or what is the proper method?
Last edited by Magneus on Tue Mar 17, 2009 8:51 pm, edited 1 time in total.

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

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#6 Post by kroddn »

Magneus wrote:

Code: Select all

/freeorion: error while loading shared libraries: libGiGiOgre.so: cannot open shared object file: No such file or directory
Maybe after compiling GiGiOgre you forgot to install it.

Change into directory GG and do "scons install" or do the following:

Code: Select all

export LD_LIBRARY_PATH=GG
./freeorion
This means that the library loader will look into directory GG for shared libs first and there is likely to find libGiGiOgre.so .

quote="Magneus"]Solved that problem by copying the GG .so files to /usr/lib.[/quote]
This is NOT a common way, you should use "scons install" inside the GG directory to install those libs.

Code: Select all

main() caught exception(std::exception): OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library ./RenderSystem_GL.  System Error: ./RenderSystem_GL.so: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 80)
I don't know how it is supposed to work, but you can edit the file ogre_plugins.cfg and specify "PluginFolder=/usr/lib64/OGRE".

The static linux version I built has those plugin libs in the same directory where "freeorion" resides - but I copied them there manually. You may use symlinks into the directory where your freeorion binary is located.

Magneus
Space Krill
Posts: 5
Joined: Tue Mar 10, 2009 11:16 pm
Location: Central NJ, USA

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#7 Post by Magneus »

Yep, I know a little bit about environmental variables.

Just tried both, and no dice. It seems that GG isn't installing, despite me typing 'scons install.'

Ah! GiGi seems to be installing to freeorion/lib. My GG options.cache file contains the line:

Code: Select all

prefix = '/home/dk/workspace/freeorion'
I added this line when NOTHING was working, based on one of the how-tos on the wiki. Is this causing GG to not install to the correct position?

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

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#8 Post by kroddn »

Of course thats the problem ;-)

Delete this line and do again a "scons configure", scons and scons install.

Nevertheless, if GiGi has compiled without errors, doing "export LD_LIBRARY_PATH=GG" should work. Those GiGi libs should be in GG.

Magneus
Space Krill
Posts: 5
Joined: Tue Mar 10, 2009 11:16 pm
Location: Central NJ, USA

The Saga Continues: CgProgramManager

#9 Post by Magneus »

Hmm. It appears that I am now lacking an OGRE plugin named "CgProgramManager." I can't seem to find it on my system at all. Should this plugin have been created during the compile of GG, or perhaps another one of the dependencies? As I mentioned above, I am using Ogre 1.6.1.

This appears to be the Debian package for the CgProgramManager plugin

How do I install this under Gentoo?

Here is the error:

Code: Select all

main() caught exception(std::exception): OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /usr/lib64/OGRE/Plugin_CgProgramManager.  System Error: /usr/lib64/OGRE/Plugin_CgProgramManager.so: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 80)
EDIT: I'm an idiot. Looks like I didn't compile nvidia-cg-toolkit properly. Let me go try that.

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

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#10 Post by kroddn »

You may also try to deactivate loading of that plugin by commenting out or deleting that line in ogre_plugins.cfg.

The nvidia toolkit can be downlaoded here:
http://developer.nvidia.com/object/cg_toolkit.html

After that, you MUST recompile and install OGRE.

You may also just wan't to try the FreeOrion linux package 0.3.12.1 from sourceforge:
http://sourceforge.net/project/showfile ... _id=660507

obgr_seneca
Space Floater
Posts: 34
Joined: Wed Mar 12, 2008 9:00 am
Location: Horb, Germany

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#11 Post by obgr_seneca »

Coming back to the original topic, I'm getting the same error-message. I'm also having graphviz 2.22 installed but I can't go back to 2.20 since I'm building packages that should run on a normal installation.

The system is Mandriva 2009.1 on an i586 machine.

Code: Select all

g++ -o UI/TechTreeWnd-human.o -c -pthread -Wall -Wno-parentheses -Wno-deprecated -O2 -DOGRE_GUI_gtk -DOGRE_CONFIG_LITTLE_ENDIAN -DFREEORION_LINUX -DENABLE_BINRELOC -DFREEORION_BUILD_HUMAN -DGL_GLEXT_PROTOTYPES -I/usr/include/python2.6 -I/usr/include/OGRE -I/usr/include/bullet -I/usr/include/graphviz -Ilog4cpp UI/TechTreeWnd.cpp
UI/TechTreeWnd.cpp: In member function 'void TechTreeWnd::LayoutPanel::Layout(bool, double)':
UI/TechTreeWnd.cpp:1704: error: 'ND_coord_i' was not declared in this scope
scons: *** [UI/TechTreeWnd-human.o] Error 1
scons: building terminated because of errors.
Is there a possibility to patch that? Oh by the way, I'm using revision 3103, the "official 0.3.13 release" for linux.

Oliver

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#12 Post by OndrejR »

obgr_seneca wrote:Coming back to the original topic, I'm getting the same error-message. I'm also having graphviz 2.22 installed but I can't go back to 2.20 since I'm building packages that should run on a normal installation.

The system is Mandriva 2009.1 on an i586 machine.

Code: Select all

g++ -o UI/TechTreeWnd-human.o -c -pthread -Wall -Wno-parentheses -Wno-deprecated -O2 -DOGRE_GUI_gtk -DOGRE_CONFIG_LITTLE_ENDIAN -DFREEORION_LINUX -DENABLE_BINRELOC -DFREEORION_BUILD_HUMAN -DGL_GLEXT_PROTOTYPES -I/usr/include/python2.6 -I/usr/include/OGRE -I/usr/include/bullet -I/usr/include/graphviz -Ilog4cpp UI/TechTreeWnd.cpp
UI/TechTreeWnd.cpp: In member function 'void TechTreeWnd::LayoutPanel::Layout(bool, double)':
UI/TechTreeWnd.cpp:1704: error: 'ND_coord_i' was not declared in this scope
scons: *** [UI/TechTreeWnd-human.o] Error 1
scons: building terminated because of errors.
Is there a possibility to patch that? Oh by the way, I'm using revision 3103, the "official 0.3.13 release" for linux.

Oliver
See wiki Linux Compile Howto errors. There is link to forum.

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

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#13 Post by Geoff the Medio »

As OndrejR wrote while I was writing this: As linked on the Compile Page: viewtopic.php?p=36349#p36349

(at the bottom of the post)

If there's an appropriate preprocessor define to get the graphviz version that could be used to make a single .cpp file work with either graphviz version, feel free to find it and post about it and perhaps make a patch.

obgr_seneca
Space Floater
Posts: 34
Joined: Wed Mar 12, 2008 9:00 am
Location: Horb, Germany

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#14 Post by obgr_seneca »

Using the following patch I deduced from the link you posted, it did compile:

Code: Select all

--- UI/TechTreeWnd.cpp  2009-06-08 10:30:42.000000000 +0200
+++ UI/TechTreeWnd.cpp.oli      2009-06-08 14:04:17.073498823 +0200
@@ -1701,8 +1701,8 @@
         const Tech* tech = GetTech(node->name);
         assert(tech);
         m_techs[tech] = new TechPanel(tech, tech == m_selected_tech, m_scale);
-        m_techs[tech]->MoveTo(GG::Pt(static_cast<GG::X>(PS2INCH(ND_coord_i(node).x) - m_techs[tech]->Width() / 2 + TECH_PANEL_MARGIN_X),
-                                     static_cast<GG::Y>(PS2INCH(ND_coord_i(node).y) - (m_techs[tech]->Height() - PROGRESS_PANEL_BOTTOM_EXTRUSION * m_scale) / 2 + TECH_PANEL_MARGIN_Y)));
+        m_techs[tech]->MoveTo(GG::Pt(static_cast<GG::X>(PS2INCH(ND_coord(node).x) - m_techs[tech]->Width() / 2 + TECH_PANEL_MARGIN_X),
+                                     static_cast<GG::Y>(PS2INCH(ND_coord(node).y) - (m_techs[tech]->Height() - PROGRESS_PANEL_BOTTOM_EXTRUSION * m_scale) / 2 + TECH_PANEL_MARGIN_Y)));
         m_layout_surface->AttachChild(m_techs[tech]);
         GG::Connect(m_techs[tech]->TechBrowsedSignal,       &TechTreeWnd::LayoutPanel::TechBrowsedSlot,         this);
         GG::Connect(m_techs[tech]->TechClickedSignal,       &TechTreeWnd::LayoutPanel::TechClickedSlot,         this);

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

Re: TechTreeWnd.cpp: 'ND_coord_i' was not declared in this scope

#15 Post by Geoff the Medio »

I won't commit a patch unless it also works with the offically required graphviz version.

Post Reply