[Python-Dev] Demo/embed causes 'import site' failure

Thomas Wouters thomas@xs4all.net
Mon, 10 Jul 2000 17:56:42 +0200

On Mon, Jul 10, 2000 at 05:44:39PM +0200, M.-A. Lemburg wrote:
> Guido van Rossum wrote:
> >     import struct,types,__builtin__
> > ImportError: /usr/local/lib/python2.0/lib-dynload/structmodule.so: undefined symbol: PyString_Type


> > But I guess what's really missing is some kind of flag that tells the
> > linker to export all symbols in the libpython2.0.a file...  Is there a
> > way?  (I feel so stupid!)

> >From man ld:
>        -export-dynamic
>               When  creating  an ELF file, add all symbols to the
>               dynamic symbol table.  Normally, the dynamic symbol
>               table contains only symbols which are used by a dy­
>               namic object.  This option is needed for some  uses
>               of dlopen.

> (Not sure whether this is what you're looking for, though.)

I think it is. The funny bit is that it should be included in LDFLAGS by
default, on Linux. BSDI and some other operating systems need it too (at
least newer versions) and gave the same error with shared libraries if the
flag was omitted (old BSDI was COFF with fake-shared-libraries, new BSDI is

I didn't bother to check, but does the embed Makefile include python's
Makefile* stuff from $prefix/config ? Does it contain -export-dynamic ? If
so, very pecurliar... ;-P

Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!