[Solved] Linux build error

iblis

12-07-2010 13:25:22

Hi all, I have what I hope is a simple question. I've built the Python Ogre bindings using the wiki guide here (after some tweaks for my version of boost_python), and can successfully run the C++ Ogre demos. However, when attempting to run the Python demos, I get this error:

iblis@atom:~/development/python-ogre/demos/ogre$ python Demo_Grass.py
Traceback (most recent call last):
File "Demo_Grass.py", line 33, in <module>
import ogre.io.OIS as OIS
File "/home/iblis/development/root/usr/lib/python2.6/site-packages/ogre/io/OIS/__init__.py", line 4, in <module>
from _ois_ import *
ImportError: dynamic module does not define init function (init_ois_)


I've looked in ~/development/root/usr/lib/python2.6/site-packages/ogre/io/OIS/, all it has is __init__.py and _ois_.so. The contents of __init__.py are:

# import warnings
# warnings.simplefilter('ignore', RuntimeWarning)
#
from _ois_ import *
# warnings.resetwarnings( )


I could be wrong, but that makes me think the .so module needs to be renamed to fit the init function. If that's the case, does anyone know where I should look to find out what the actual OIS init function is, so that I can correctly rename the ois shared object and be on my way?

Thanks in advance!

EDIT: I've figured out what the error was. I was compiling python-ogre on an eeepc with only 1 gb of ram, and running make -j2 was causing the kernel to kill g++ due to out of memory errors. Hard coding NUMBER_OF_CORES to 1 fixed that error, however I hadn't been aware that BuildModule.py -g would only generate code if the directory hadn't been created. Since it had died in the middle of generating the OIS code, it wasn't regenerating it during subsequent runs. A quick rm -rf on ~/development/python-ogre/generated/ois_1.0, then re-running BuildModule.py -g ois corrected the issue.

Awesome work guys. I can't wait to play with ogre from a python repl. :D