Undefined symbols when importing extension module.

Mahrt, Dallas dallasm at aiinet.com
Sun Jan 19 01:04:54 EST 2003


First the application:

I am writing a library which embeds the Python interpreter. This library is
created as a shared library which is loaded (at runtime) by an application
to add 'Python support'. To reduce resource consumption, the Python
interpreter is compiled as a shared library (version 2.2.1 with back-ports
of the 2.3 patches for building as a shared library) . This is all being
written for Linux.

Now that my convoluted application has been explained, here is the problem I
am noticing. I have the application written so a test python module is being
imported. This module imports the time module (time.so) which complains that
it can't locate the symbol 'PyExc_IOError'. Now based on some posts I've
seen (and against the warnings of many) I added a call to
setdlopenflags(RTLD_NOW | RTLD_GLOBAL). This worked for a while until I
added multithread support (PyEval_InitThreads), now I am getting the same
problem. Confuses the heck out of me.

Now I don't expect definitive answers but I would appreciate some
suggestions on where/what to try. I have so far ensured that the libraries
are linked with '-export-dynamic'

(And yes I realize that this is one odd application of Python, did I
mentions its cross-compiled ;-) ) 

---
Dallas S. Mahrt              dallasm at aiinet.com





More information about the Python-list mailing list