Problem with linking embedding C application

Gerhard Häring gh_pythonlist at gmx.de
Mon Oct 1 07:49:18 EDT 2001


On Mon, Oct 01, 2001 at 01:16:58PM +0200, Mads Bondo Dydensborg wrote:
> On Mon, 1 Oct 2001, Olivier Deme wrote:
> 
> > Hi,
> > 
> > We have written an application written in C, which invokes sometimes
> > the Python interpreter for executing Python methods.
> > 
> > So, I am trying to statically link our application with
> > libpython*.*.a., but this result in various undefined symbols (see
> > below).  [...] 
>  [...] 
> I have a machine, where I need to do: -lnsl -ldl -lreadline -ltermcap
> -lpthread -lutil -lm to be able to link with python.
> 
> The annoying thing is, that it is very hard to determine this in
> general. At least I am not aware of any way to do it.

I think this will do it. It does work for me:

from distutils.sysconfig import get_config_var
print get_config_var("LIBS") + " " + get_config_var("SYSLIBS")

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))




More information about the Python-list mailing list