Python/C API: using from a shared library

Graham Dumpleton Graham.Dumpleton at gmail.com
Wed Nov 26 17:24:44 EST 2008


On Nov 26, 10:29 pm, Robie Basak <ro... at justgohome.co.uk> wrote:
> On 2008-11-25, Robie Basak <ro... at justgohome.co.uk> wrote:
>
> > If I use dlopen() to open a shared library that I've written, and that
> > shared library tries to use the Python/C API, then it fails. I've
> > reduced the problem to the test case below. The error is:
>
> > ImportError: /usr/lib/python2.5/lib-dynload/time.so: undefined symbol:
> > PyExc_ValueError
>
> I've submitted a bug for this. Seehttp://bugs.python.org/issue4434for
> an more detailed explanation and a workaround.

It isn't a bug in Python. You need to link the Python shared library
to your shared library properly. You appear not to be doing this.

Graham



More information about the Python-list mailing list