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

Aaron Bentley abentley at panoramicfeedback.com
Wed Nov 10 16:37:02 CET 2004


Rene Rivera <grafik.list <at> redshift-software.com> writes:

> 
> John Meinel wrote:
> 
> > I thought that worked for both dynamic and static libraries. The 
> > alternative in my mind would be
> >   <library-file>$(LIBPDF_PATH)/libpdf.a
> > 
> > You can either hard code $(LIBPDF_PATH), or what I prefer is to add the 
> > line:
> 
> You can also use a relative path to it:
> 
> 	<library-file>../.libs/libpdf.a
With <library-file> or with <find-library>, I get the same results.  Jam appears
to succeed:

---
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




More information about the Cplusplus-sig mailing list