Undefined Symbol

nekstrom

18-02-2006 22:06:19

Hello everyone,

I'm trying to get pyogre working on a gentoo 64-bit linux distribution. I can get everything to build just fine however whenever I try to import pyogre.ogre it gives the error:

import _ogre
ImportError: /usr/lib64/python2.4/site-packages/pyogre/_ogre.so: undefined symbol: _ZN4Ogre10MouseEventC1EPNS_14PositionTargetEiififfffffi

Any one have an idea what library isn't getting linked in? Or what is going on? Any help with this would be appreciated.

griminventions

19-02-2006 03:05:52

Dunno if this is a similar problem, but http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=197 has info about some Linux issues.

nekstrom

19-02-2006 10:38:51

Did you post the wrong link? That thread doesn't seem to have anything about linux in it.

griminventions

19-02-2006 15:52:49

About the middle of page 2 of that thread starts talking about Linux, right? Or am I confused?

At minimum, there is one thing in that thread you could try:
So I played around with the folder structure a bit, I changed the name of the demo folder from c:\Python24\pyogre\ogre_demos to C:\Python24\pyogre\demos and voila, it works.
...depending on which version of PyOgre you have. If it's 1.0.5.0 then the above should fix it. Otherwise I think the ogre_demos directory is correct for versions 1.0.5.1 and 1.0.6.0.

Hope I haven't confused you. :?

nekstrom

21-02-2006 05:47:34

What version of ogre should I be using if I am using pyogre from trunk of svn? It won't build with CVS version of OGRE and 1.0.6 has a bunch of undefined links in the .so file, as stated above.

dermont

21-02-2006 07:41:05

Both pyogre-1.0.6.0 and svn trunk are currently for Ogre 1.0.6. Pyogre-1.0.6.X's are meant to be stable release snapshots and svn trunk updates / bugfixes on the last stable release. AFAIK bi-monthly the updates are supposed to be propogated to a new releases 1.0.6.1, 1.0.6.2 etc. But as you know pyogre-1.0.7.0 has already been released.
Anyway, you should using ogre version 1.0.6 to build from pyogre's svn trunk. You need to apply the following updates:

Add EventSystem.cxx to setup.py, e.g.

ext_ogre = pyogre_Extension("pyogre._ogre",
["pyogre/ogre/ogre.i",
"pyogre/ogre/VertexBufferProxy.cxx",
"pyogre/ogre/IndexBufferProxy.cxx",
"pyogre/ogre/EventSystem.cxx"],
pkg_config_module='OGRE')


Edit pyogre/ogre/EventSystem.cxx

//EventSystem *Singleton<EventSystem>::ms_Singleton = 0;
template <> EventSystem *Singleton<EventSystem>::ms_Singleton = 0;


a) Ensure that you remove any old versions of ogre's libs from /usr/local/lib/OGRE and /usr/local/lib/*Ogre* before compiling / installing another version. And running ldconfig as su after installation.
b) before running pyogre's "setup.py build" clear out any old wrappers/libs :


- run setup.py clean
- manually remove the wrapper files from pyogre-1.0.6-0/pyogre/ogre
ogre_wrap.cxx
ogre_wrap.h

- manually remove the wrapper files from pyogre-1.0.6-0/pyogre/cegui
cegui_wrap.cxx
cegui_wrap.h

- remove any old pyogre lib versions,if needed,from pyogre-1.0.6-0/build/
lib.linux-i686-2.3
temp.linux-i686-2.3


c) Make sure your using the same version of gcc/g++ to compile Ogre and pyogre.
For example my default version of gcc 3.x.x. When I compile for gcc 4.0.x, I have to:


export CXX="g++-4.0"
export CC="gcc-4.0"
setup.py build


nekstrom

21-02-2006 20:06:37

Thanks for all of your help guys. It turns out the only problem I had was that I wasn't regenerating the ld.so.cache in /etc. Once I did that it all seems to work. Thanks again.