Linux: undefined symbol importing core ogre module.


13-07-2006 12:57:59

hi all,

i've just sucessfully built and installed PyOgre on a Debian Sid, however when trying any of the demos (and yes after a regenerated i get the following output:

import pyogre.ogre as ogre
File "/usr/lib/python2.4/site-packages/pyogre/", line 4, in ?
import _ogre
ImportError: /usr/lib/python2.4/site-packages/pyogre/ undefined symbol: _ZN4Ogre9SingletonI11EventSystemE12ms_SingletonE

i've looked through the forums and i see another thread reporting the same error, but it comes from mithro's PyOgre Debian packages (which I'm not using). it also hasn't yet let to anywhere and has a distracting topic name:

here's my build context:

dpkg -l | grep ogre:

ii libogre-dev 1.0.6-1.4
ii libogre5c2a 1.0.6-1.4

dpkg -l | grep cegui:

ii libcegui-mk2-0c2a 0.4.1-1.2
ii libcegui-mk2-dev 0.4.1-1.2

i built PyOgre with:

python2.4 install

after making the following changes:

i commented out:

%include OgreDataStream.i

in pyogre/ogre/ogre.i


pkg_config_module='CEGUI CEGUI-OPENGL CEGUI-OGRE',

in to read:

pkg_config_module='CEGUI CEGUI-OGRE'

i'm using GCC version:

gcc -v
gcc version 4.1.2 20060613 (prerelease) (Debian 4.1.1-5)

at this point it built fine.

hope it's alright to reiterate here.



13-07-2006 13:12:33

Try adding EventSystem cxx file to ... ventsystem


And why have you commented out OgreDataStream.i. There were undefined symbols from OgreDataStream.i using Ogre1.0.5 which were due to the .map option not being disabled. This isn't the case for Ogre1.0.6. ... up_id=3464


13-07-2006 17:37:39

thanks, i tried what you suggested in that thread. this is what i did.

1: python2.4 clean

2: removed all the old wrapper files for both CEGUI and OGRE

3: added EventSystem.cxx to using the instructions you give in

4: added template useage to EventSystem.cxx as you suggest in the same post, commenting out the existing line.

5: re-enabled OgreDataStream.i include in ogre.i

6: python2.4 install

.. it compiled cleanly.

7: ran ldconfig as su

but sill it fails with the same error when running any demo.

this is the fourth time i've tried to build and then run demos with PyOgre in the last year or so. i fear there is another problem getting in the way.

thanks alot for your help.


13-07-2006 19:58:07

Any time I've encountered similar problems regenerating the has always resolved it. Things that you may try/check:

1) Try checking if the EventSystem symbol exists From top pyogre build dir, run (change paths to match your distro):

nm build/lib.linux-i686-2.4/pyogre/ |grep '_ZN4Ogre9SingletonI11EventSystemE12ms_SingletonE'

>> 009a50e4 B _ZN4Ogre9SingletonI11EventSystemE12ms_SingletonE

nm /usr/lib/python2.4/site-packages/pyogre/ | grep '_ZN4Ogre9SingletonI11EventSystemE12ms_SingletonE'
>> 009a50e4 B _ZN4Ogre9SingletonI11EventSystemE12ms_SingletonE

2) Appears python clean only cleans build/temp.linux-i686-2.4 dir:

- goto build/lib.linux-i686-2.4/pyogre and clear out that directory
- remove all the old wrapper files for both CEGUI and OGRE as you previously did

python clean
python build
python install

3) Manually clear out /usr/lib/python2.4/site-packages/pyogre dir

python install


17-07-2006 00:43:32

thanks for your detailed help.

nm does show that the symbol is undefined. trying your two suggestions however still leaves me with the same error on exec.

there is no Ogre or CEGUI installation on the machine other than that in /usr/lib, put there by dpkg, an updated locatedb proves this.

i cleaned out the wrapper files and build directory. ran python2.4 clean anyway, built pyOgre (easily) with python2.4 build. i then cleared out the files from the only pyOgre install on the machine, /usr/lib/python2.4/site-packages/pyogre, reinstalled with python2.4 install, manually removed /etc/ (to be superstitious) and ran ldconfig.

sadly i still have the same undefined symbol and so i think the issue is elsewhere. i'll try to build, install and run pyOgre on another machine (Ubuntu) next month. in the meantime i'll stick with C++ until i next have time to find the real culprit.

thanks again.