python2.4-dbg and C modules

H

hanke

Hello,

please, when I try to run my code under python2.4-dbg
from Ubuntu, the interpreter complains that the Py_InitModule4
symbol is undefined in a C module I'm using (PyOpenAL):

ImportError: /var/lib/python-support/python2.4/_openal.so: undefined
symbol: Py_InitModule4

Google reveals that this problem is not specific just to PyOpenAL,
but I couldn't find out what is the essence of the problem and how
python-2.4dbg is different from python2.4 except for including
debugging symbols, because in plain python2.4 the module works
fine. Also, the same thing happens with python 2.5 (not the
-dbg variant).

Please, what is the problem and how to overcome it?

Thank you,
Hynek Hanke
 
M

Martin v. Löwis

please, when I try to run my code under python2.4-dbg
from Ubuntu, the interpreter complains that the Py_InitModule4
symbol is undefined in a C module I'm using (PyOpenAL):

ImportError: /var/lib/python-support/python2.4/_openal.so: undefined
symbol: Py_InitModule4

Google reveals that this problem is not specific just to PyOpenAL,
but I couldn't find out what is the essence of the problem and how
python-2.4dbg is different from python2.4 except for including
debugging symbols, because in plain python2.4 the module works
fine.

The dbg version does not define Py_InitModule4, but
Py_InitModule4TraceRefs. This is a safety-measure to prevent modules
compiled for the nodebug version of Python to load into the debug
version. There are major changes to the internal interpreter data
structures in the debug version, so you have to recompile your module
with the debug headers.

HTH,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top