Boost logo

Boost Users :

From: Scott Amort (jsamort_at_[hidden])
Date: 2006-07-18 17:40:35


Hi All,

I am trying to statically link a shared library I am developing with the
Boost Regex library. I get the following error:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld:
/usr/lib64/libboost_regex.a(instances.o): relocation R_X86_64_32 against
`boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>,
boost::re_detail::cpp_regex_traits_implementation<char>
>::do_get(boost::re_detail::cpp_regex_traits_base<char> const&, unsigned
long)::s_data' can not be used when making a shared object; recompile
with -fPIC

I have run across this once before, and although I am not really clear
why, it appears that on my AMD64 platform, if I try to link a static
library into a shared library, that static library needs to be compiled
with -fPIC (this requirement does not exist for normal x86 platforms).

My question is: is there an already available option that I can add when
compiling the Boost libraries to enable this setting? I am not at all
familiar with the BJam build system.

Thanks for any assistance!

Best,
Scott


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net