undefined symbols when linking Python into a shared library

Michael Neuroth michael.neuroth at freenet.de
Thu Mar 7 19:17:31 EST 2002


"Martin v. Loewis" writes:

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

Thank you for the tip, now I can see, that the 'missing symbol' is
exported from the shared library:

  000a7bac D _Py_NoneStruct

Is there any difference for exported (data) symbols, when loading
a shared library with dlopen() instead of linking it 'statically' while
creating the program file?

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

That is true of course. Is there any possibility to create a shared
libraray for Python: libpython.so instead of libpython.a?
I have not found any option in the ./configure script.
Is there any reason against shared libraries?

Regards,

  Michael.





More information about the Python-list mailing list