undefined symbols when linking Python into a shared library

Martin v. Loewis martin at v.loewis.de
Tue Mar 5 18:36:02 EST 2002


Michael Neuroth <michael.neuroth at freenet.de> writes:

> I link libpyhton.a into the shared library, I tried also to link
> with the option -Xlinker -export-dynamic, as told by the python
> documentation (section:Extending and Embedding the Python Interpreter,
> 5.6 Linking Requirements). The shared library is a little bit lager,
> but the resulting error is the same. How can I verify, that this
> symbols are in the shared library?

On Linux, use "nm -D foo.so" to see the symbols exported by foo.so.

> What is the magic option to solve that (linker?) problem?

You'll need to understand the problem first before trying to find a
solution. I, for one, can only guess what is going on: most likely,
your shared library really does not provide the symbol missing in
_tkinter.so; this is probably not surprising, since the linker, when
creating the library, had no clue that the symbol might be needed.

In any case, it is a bad idea to incorporate libpython.a object files
into a shared library, as this is non-PIC code.

Regards,
Martin



More information about the Python-list mailing list