Linux: undefined symbol importing core ogre module.

delire

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 ld.so.cache) i get the following output:

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: _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:

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=1470&sid=479cda68bd3a942ad379aa37b4461930

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 setup.py install

after making the following changes:

i commented out:

%include OgreDataStream.i

in pyogre/ogre/ogre.i

changed:

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

in setup.py 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.

cheers

dermont

13-07-2006 13:12:33

Try adding EventSystem cxx file to setup.py:
http://www.ogre3d.org/phpBB2addons/view ... ventsystem

Edit:

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.
https://developer.berlios.de/bugs/?func ... up_id=3464

delire

13-07-2006 17:37:39

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

1: python2.4 setup.py clean

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

3: added EventSystem.cxx to setup.py using the instructions you give in http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=510&highlight=eventsystem

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 setup.py 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.

dermont

13-07-2006 19:58:07

Any time I've encountered similar problems regenerating the ld.so.cache 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/_ogre.so |grep '_ZN4Ogre9SingletonI11EventSystemE12ms_SingletonE'

>> 009a50e4 B _ZN4Ogre9SingletonI11EventSystemE12ms_SingletonE

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


2) Appears python setup.py 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

Rerun:
python setup.py clean
python setup.py build
su
python setup.py install
ldconfig


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

su
python setup.py install
ldconfig

delire

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 setup.py clean anyway, built pyOgre (easily) with python2.4 setup.py 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 setup.py install, manually removed /etc/ld.so.cache (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.