Boost logo

Boost Users :

Subject: Re: [Boost-users] x86_64 needs -fPIC issue, anyone successful?
From: Bill Freeman (bfreeman_at_[hidden])
Date: 2010-08-06 12:41:46

Bill Freeman wrote:

> I'm trying to build a library (librets) that links
> against boost libraries in order to build a shared
> library (as part of a SWIG based python extension).
> /usr/bin/ld: /home/f/Desktop/rets/lib/libboost_system.a(error_code.o):
> relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
> making a shared object; recompile with -fPIC
> Or, if not, can someone tell me how to tell the bjam
> stuff to apply -fPIC so that I can try that.
Neal Becker wrote:
You should have a to link against (which should have, and
probably was, built with -fpic).

1) You don't have where linker is looking or

2) Usually these are setup as symlinks, ->

You could be missing the symlink, or it could point to the wrong place.

The so files are there. But librets explicitly wants the .a, presumably
because it wants to bind in the actual code, rather than the stub.
While python extension libraries themselves need to be shared, so that
they can be loaded dynamicly, at run time, the librets folks apparently
don't want to depend on the boost shared libraries being installed on the
target system.

While the wisdom of that choice is debatable, librets is simply something
I want to use (from python). I'm not involved in its development community.

I'm just looking for the easy way out. Getting the boost static's built
PIC seems worth trying.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at