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

Domenico Andreoli cavok at tiscali.it
Tue Feb 7 10:12:51 CET 2006


On Mon, Feb 06, 2006 at 09:23:16PM -0500, Stefan Seefeld wrote:
> 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.)

i'm not sure that setting LD_LIBRARY_PATH would solve the problem. this
is because the loader can't load a library that has not been linked at
link time. i'm instead pretty sure that ldd does not print about any
missing library for your module. go ahead and link it.

to save time, in my boost.python projects i try to import the module
at build time. this way i discover immediately that the module is
not usable.


-----[ Domenico Andreoli, aka cavok
 --[ http://people.debian.org/~cavok/gpgkey.asc
   ---[ 3A0F 2F80 F79C 678A 8936  4FEE 0677 9033 A20E BC50

More information about the Cplusplus-sig mailing list