Mail delivery failed: returning message to sender

Ignacio Vazquez-Abrams ignacio at
Tue Aug 28 22:16:29 CEST 2001

On Tue, 28 Aug 2001, Chachkoff Yann wrote:

>  I know that this may be quite a common question, but since I was unable to
>  find the answer, I ask :
>   [snip]
>  I get the following error:
>  ImportError: /usr/lib/python2.0/lib-dynload/ undefined
>  symbol: PyString_Type
>  Following my searches, it seems that I need to tell the linker to export
>  all symbols of the dynamic symbol table, so I tried to add -export-dynamic
>  (or -E) in the main making line, but it does not work. What should I do ?
>  Anyone has an idea ?
>  Chachkoff Y.

Section 5.2 of the Extending and Embedding the Python Interpreter says:

"The problem is that some entry points are defined by the Python runtime
solely for extension modules to use. If the embedding application does not use
any of these entry points, some linkers will not include those entries in the
symbol table of the finished executable. Some additional options are needed to
inform the linker not to remove these symbols.

Determining the right options to use for any given platform can be quite
difficult, but fortunately the Python configuration already has those values.
To retrieve them from an installed Python interpreter, start an interactive
interpreter and have a short session like this:

      >>> import distutils.sysconfig
      >>> distutils.sysconfig.get_config_var('LINKFORSHARED')
      '-Xlinker -export-dynamic'

The contents of the string presented will be the options that should be used.
If the string is empty, there's no need to add any additional options. The
LINKFORSHARED definition corresponds to the variable of the same name in
Python's top-level Makefile."

The '-Xlinker' tells gcc to pass '-export-dynamic' to ld. gcc itself seems to
ignore it otherwise.

Ignacio Vazquez-Abrams  <ignacio at>

More information about the Python-list mailing list