Undefined Symbol ZTIN4Ogre16MemoryDataStreamE


18-10-2005 12:07:12


I'm trying to use pyogre on my linux box (Gentoo). I installed python2.4, swig-1.3.25, psyco-1.2, and pyogre from the current SVN checkout.

Everything went fine so far but when I try to run the tests the module will not being loaded due to this undefined symbol. I grep'd all my libraries using 'nm' but I could not find such a symbol anywhere except for ogre_wrap.o. So where does this symbol came from? Did I missed some compile option for any of these packages to get it compiled in?

I'm quite lost and hope you can help me on that.

Thanks in advance!


22-10-2005 05:54:28

I have this too, ubuntu 5.40, python 2.4, swig-1.3.25, most recent SVN version of pyogre. Here is the error message:

mivey@gimli:~/svn_co/pyogre/demos/ogre$ python SkyPlaneDemo.py
Traceback (most recent call last):
File "SkyPlaneDemo.py", line 2, in ?
import pyogre.ogre as ogre
File "/usr/lib/python2.4/site-packages/pyogre/ogre.py", line 4, in ?
import _ogre
ImportError: /usr/lib/python2.4/site-packages/pyogre/_ogre.so: undefined symbol: _ZTIN4Ogre16MemoryDataStreamE

I did a little bit of hunting, first in the PyOgre directory:

mivey@gimli:~/svn_co/pyogre$ grep _ZTIN4Ogre16MemoryDataStreamE . -r
Binary file ./build/temp.linux-i686-2.4/pyogre/ogre/ogre_wrap.o matches
Binary file ./build/lib.linux-i686-2.4/pyogre/_ogre.so matches

And then in the directory where I compiled Ogre:

mivey@gimli:~/Documents/dl/tmp/ogrenew$ grep _ZTIN4Ogre16MemoryDataStreamE . -r
Binary file ./OgreMain/src/OgreDataStream.lo matches
Binary file ./OgreMain/src/.libs/libOgreMain.so.5.4.0 matches
Binary file ./OgreMain/src/.libs/libOgreMain.so.5 matches
Binary file ./OgreMain/src/.libs/libOgreMain.so matches
Binary file ./OgreMain/src/OgreDataStream.o matches

So, what else can I provide that would help debug the problem? I'm not familiar with it so I don't know what to do next.


22-10-2005 06:06:59

Sorry cybin, I don't know how I missed this message earlier.

Open up pyogre/ogre/ogre.i and comment out this line:
%include OgreDataStream.i

This should fix the problem, but please let me know if it doesn't. I think this is some kind of inconsistancy between gcc and MSVC, because I don't have these problems. Hopefully fog can shed some light on this.

What version of Ogre do you have installed? What version of GCC are you using to compile this?


22-10-2005 09:02:37

Hi Clay!

Thank you very much. Now I can import the module pyogre.ogre. But when I try to run the demos I get the following message:

Traceback (most recent call last):
File "CameraTrackingDemo.py", line 80, in ?
File "/home/cybin/Documents/Source/pyogre-trunk/demos/ogre/SampleFramework.py", line 23, in go
if not self._setUp():
File "/home/cybin/Documents/Source/pyogre-trunk/demos/ogre/SampleFramework.py", line 33, in _setUp
self.root = ogre.Root(ogre.getPluginPath())
File "/usr/lib/python2.4/site-packages/pyogre/ogre.py", line 11476, in __init__
newobj = _ogre.new_Root(*args)
TypeError: argument number 1: null reference of type 'Ogre::String' was received

I'm sorry, but I'm not familar with Python so I don't know what it means. I guess this happens when ogre will be instanciated without any arguments or something like that. But that's just a guess. Well, that's what I use here:

Gentoo 2005.1
gcc 3.3.5-20050130
Python 2.4.2

Hope that helps.

Thank you,



22-10-2005 20:56:32

I had the same problem. It is because "plugins.cfg" isn't in the demo directory. I had to copy the plugins.cfg that came with the Ogre samples, and the media directory that came with the Ogre samples. After that I could run the pyogre demos.


22-10-2005 21:02:37

Hmm, it sounds like the ogre.getConfigPath isn't working under linux. I'll see if I can get fog to take a look at it.

Sorry I'm a windows person myself. I have a hard time debugging these problems. =/

Edit: This is the code:
def getPluginPath():
"""Return the absolute path to a valid plugins.cfg file."""
import sys
import os
import os.path

paths = [os.path.join(os.getcwd(), 'plugins.cfg'),
for path in paths:
if os.path.exists(path):
return path

Does this function actually return anything meaningful for you? Also can you check to see that /etc/OGRE/plugins.cfg actually exists, and if not, where your Ogre distribution actually stores it at?

Future versions of this code will throw an ogre.OgreException so that this problem is properly reported.


24-10-2005 11:32:37

My Debian packages manage /etc/OGRE and automatically update the plugins.cfg file when new .deb-packaged plugins are installed. But for everybody else the only meaningful location is the current directory (I don't like the module directory at all because on linux we use the installed ogre not a budled version built for pyogre only.)

I'll fix this by printing a nice error message and then raising an error if plugins.cfg can't be found.


27-10-2005 13:26:26


I've got it running now. Since I did the modification I had had other problems besides. So I decided to write an ebuild script that fetch a fresh source via subversion.

Everything compiled smoothly now and after I copied the .cfg files into the working directory all the examples I've tried were running fine so far. I had a problem when I first compiled it using threads, so I configured it out this time and it works. So I guess that either the modification regarding to that DataStream are already checked into the SVN repository or it vanished somehow.

I guess this is a clean way to get that thing built on Gentoo and at least for me it works fine.

If anyone is interested to get that ebuild script just drop me a message because I don't know when or wether I will put it online somewhere.

Great thanks for Clay and fog.



27-10-2005 16:30:40

I'd love to get my hands on any build script. Would you mind mailing it to me? (My email is at the bottom of this message.) Thanks.