C++ extension module crashes on Solaris

Guido van Rossum guido at python.org
Sat May 20 04:42:49 CEST 2000


sharris at nospam.primus.com (Steven E. Harris) writes:

> Again, I copy the (re)built module into place and try to import it:
> 
> $ cp seh_test.so ~/usr/local/lib/python1.5/
> $ python
> Python 1.5.2 (#1, May 19 2000, 09:34:45)  [GCC 2.95.2 19991024 (release)] on sunos5
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> import seh_test
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
> ImportError: ld.so.1: python: fatal: relocation error: file ./seh_test.so: symbol PyExc_IndexError: referenced symbol not found
> >>>
> 
> 
> Note that I can compile and use the CXX Demo application, which uses
> both extension and embedding together. I can't get extending to work
> alone, though.

It seems your shared library module doesn't see the symbols defined by
the Python main app.  Normally, these are being exported by default.
I wonder if the trick of using g++ for the linker breaks this?

One thing you could try is to link your module statically...

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list