I just installed boost on Ubuntu 12.04 64 bit. I used following instructions to do it:
sudo apt-get install libboost-all-dev
I can use the include parts of the boost library, but when I try to do a static linking with libboost_thread.a, I get following error message:
/usr/bin/ld: /usr/lib/libboost_thread.a(thread.o): relocation R_X86_64_32 against `tls_destructor' can not be used when making a shared object; recompile with -fPIC
/usr/lib/libboost_thread.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
In my makefile, I have following:
CFLAGS = -I./include -I./v_repExtRemoteApi -Wall -fPIC
LDFLAGS = -lpthread -ldl
CFLAGS += -D__linux
OPTION = -shared
EXT = so
BOOST_LIB_PATH = /usr/lib
OBJS_ADDITIONAL = $(BOOST_LIB_PATH)/libboost_thread.a
From my understanding, I need to recompile libboost_thread.a
Why do I need to recompile it? Because it is the 32 bit version?
And the other question is, how do I recompile it? In the past I would download the library manually and build it manually from the install directory, but by installing it with 'sudo apt-get install libboost-all-dev' I got confused.
Any help is appreciated, thanks a lot!