[C++-sig] Re: boost.Python/Jam with shared libraries

John Meinel john at johnmeinel.com
Wed Nov 10 16:43:08 CET 2004


Aaron Bentley wrote:
> Rene Rivera <grafik.list <at> redshift-software.com> writes:
> 
> 
>>John Meinel wrote:
>>

[...]

> ---
> abentley at troll:~/programming/python$ ./go.sh 
> ...found 1290 targets...
> ...updating 4 targets...
> gcc-C++-action bin/python/pfengine.so/gcc/debug/shared-linkable-true/pfengine.o
> gcc-Link-action bin/python/pfengine.so/gcc/debug/shared-linkable-true/pfengine.so
> Chmod1 bin/python/pfengine.so/gcc/debug/shared-linkable-true/pfengine.so
> gcc-C++-action bin/python/pfengine.so/gcc/debug/shared-linkable-true/pfengine.o
> gcc-Link-action bin/python/pfengine.so/gcc/debug/shared-linkable-true/pfengine.so
> Chmod1 bin/python/pfengine.so/gcc/debug/shared-linkable-true/pfengine.so
> ...updated 4 targets...
> ---
> 
> But I can't import it:
> ---
> 
>>>>import pfengine
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: /home/abentley/programming/.libs/libchart.so.0: undefined symbol:
> PDF_setrgbcolor_fill
> ---
> 
> I suppose it's possible that the problem is caused by trying to link a static
> library into a shared library, but you'd think that would be possible.  I guess
> I could try to convert libpdf.a into a shared library.  Who'd have thought I'd
> have more trouble linking to C than to C++?
> 
> Aaron
> 

You might want to try the "don't do it but tell me what you want to do." 
flag.

bjam -n

So that you can check the link line and make sure that it is trying to 
link with libpdf.a.

Just delete your pfengine.so.* file so that it forces a rebuild.
I think it is okay to have a shared library link a static one. Though 
I've noticed that a static library will not link with another static lib.

Example:

lib other
   : otherlib.cpp
;
lib mylib
   : mysource.cpp
     <lib>other
;

I end up with 2 libraries, but mylib does not contain the objects that 
exist in other. So that if later I try:

extension myext
    : myext.cpp
      <lib>mylib
      <lib>other # I must have this line,
		# even though it is supposedly in mylib
;

This easily could not be a bjam thing, and is simply how libraries work. 
And it might also depend on platform.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20041110/437d7a72/attachment.pgp>


More information about the Cplusplus-sig mailing list