[C++-sig] linking with non-python libraries

Stefan Seefeld seefeld at sympatico.ca
Tue Feb 7 03:23:16 CET 2006


Ben Veal wrote:

> I manage to build the extension OK (both manually and using pyplusplus), 
> however when I try to import it, I get the following message:
> 
> ImportError: /usr/lib/python2.3/MyClient.so: undefined symbol: 
> _ZN8BaseClassC2ERKS_
> 
> I suppose it can't find the library containing the base class. I use the 
> following lines in my Jamfile to link with the appropriate libraries:

The error message is emitted at runtime, not link time. Therefor, you
should instruct the loader how to find the library, not the linker.
Since you mention linux, I suggest you set the LD_LIBRARY_PATH variable
to contain the path to your library. (Running 'ldd' on your extension
module will tell you what third-party libraries it depends on and whether
and where it finds them.)

HTH,
		Stefan



More information about the Cplusplus-sig mailing list