Problem with linking embedding C application

Mads Bondo Dydensborg madsdyd at challenge.dk
Mon Oct 1 08:40:19 EDT 2001


On Mon, 1 Oct 2001, Gerhard Häring wrote:

> 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")

Thanks, that is nice.

Am I correct in assuming that this module is rather new? (I just checked,
it does not seem to be present in Python 1.6, but is very much in 2.0).

Where did you figure out about "LIBS" and "SYSLIBS" from? 

Thanks,

Mads 

-- 
Mads Bondo Dydensborg.                               madsdyd at challenge.dk
The US population is 4 % of the global one. They produce 23 % of the global 
pollution.





More information about the Python-list mailing list