Boost logo

Boost Users :

Subject: [Boost-users] solved - Can't dynamically load shared lib that is statically linked to boost thread
From: Greg Carter (greg9504_at_[hidden])
Date: 2012-02-02 00:05:01


Well it turns out despite not receiving any link errors I wasn't linking to
libboost_thread.a as I thought I was. On Windows this seems to be handled
by the auto link facility and I figured the same on linux. Which explains
why when I explicitly link to the shared libboost_thread.so everything
worked. However explicitly linking to the static libboost_thread.a
resulted in a link error of relocation R_X86_64_32 ... recompile with
-fPIC.

Doing a custom compile with the fPIC option set fixed that.

./bjam -a --prefix=/usr/local/boost_1_47_0 cxxflags=-fPIC --with-thread

This only seems to have updated the stage directory though and not
boost_root/lib. Not sure why that is as I didn't pass the --stage option.



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