Python embedding & question about autoconf and dynamic linking

Olivier Deme olivier.deme at airtel-atn.com
Mon Oct 1 08:46:49 EDT 2001


I am myself into the same situation...
I am trying to link my C application against libpython and I get unresolved symbols with
posix thread related symbols. Why the heck would I need the posix thread library if I never
create any thread ?!?

Why is it so difficult to do something as common as this?

O.



In article <mailman.1001714851.11810.python-list at python.org>, Mads Bondo
Dydensborg <madsdyd at challenge.dk> wrote:

> Hi there
> 
> I am trying to use Python as an embedded interprenter. Whilst it is
> quite easy to understand the C interface, I have found it _very_ hard to
> figure out what flags I need to pass to the linker to get a succesfull
> compile. It seems to depend rather heavily on a lot of parameters.
> 
> So, my first question is if there are any autoconf macros out there that
> will work for me, sort of like a AM_PATH_SDL macro? I have been
> searching around, and found one from on of the KDE libs, but it seems to
> break rather quickly for everything else than Python 1.5 (which it seems
> to be only partly succesfull in anyway).
> 
> My next question is with respect to dynamicly linking to the python
> interprenter, when embedding it. All info I have been able to find,
> points towards linking statically with libpython.<version>.a - however,
> this adds about 660KB to my application, and in general I would much
> rather link to a .so file - but I have not been able to find "such a
> beast" or instructions on how to build one. Is it possible? Or is there
> a clever way arond this kind of problem that I - beeing a clueless
> newbee - have totally overlooked? (Maybe some weird extension trickery?)
> 
> Thanks in advance!
> 
> Mads
>



More information about the Python-list mailing list