linking embedded python

Gerhard Häring gerhard.haering at opus-gmbh.net
Thu Sep 5 05:51:51 EDT 2002


Keith S. wrote:
> Hi,
> 
> This might be a dumb question, but how does one link
> a C++ application in Unix with embedded python?
> [...] However, when I try and link, I get errors like:
> 
> Undefined                       first referenced
>   symbol                             in file
> dlsym 

You need to link against additional libraries. To find out which ones,
doing a ldd (or whatever the SunOS equivalent of it is) on the python
executable should tell you.

Does this work for you, too?:

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

It seems to work for some people, but not for everybody.

-- Gerhard



More information about the Python-list mailing list