Hi,
I'm new to Boost, I've been trying to use the Thread library that boost
offers. I'm on a Kubuntu 7.1 box using G++ 4.1 Compiler with Boost 1.34.
I've only been successful compiling my project when including
libboost_thread-gcc41-mt-d.so library file. I would much rather use the
.a file however, If I try to use the libboost_thread-gcc41-mt-d.a
library file, i get the following errors:
/home/andresh/DVRTranslators/Boost/lib/libboost_thread-gcc41-mt-d.a(thre
ad.o): In function `boost::thread::join()':
/home/andresh/DVRTranslators/Boost/boost_1_34_1/libs/thread/src/thread.c
pp:226: undefined reference to `pthread_join'
/home/andresh/DVRTranslators/Boost/lib/libboost_thread-gcc41-mt-d.a(thre
ad.o): In function `~thread':
/home/andresh/DVRTranslators/Boost/boost_1_34_1/libs/thread/src/thread.c
pp:191: undefined reference to `pthread_detach'
/home/andresh/DVRTranslators/Boost/boost_1_34_1/libs/thread/src/thread.c
pp:191: undefined reference to `pthread_detach'
/home/andresh/DVRTranslators/Boost/lib/libboost_thread-gcc41-mt-d.a(thre
ad.o): In function `thread':
/home/andresh/DVRTranslators/Boost/boost_1_34_1/libs/thread/src/thread.c
pp:156: undefined reference to `pthread_create'
/home/andresh/DVRTranslators/Boost/boost_1_34_1/libs/thread/src/thread.c
pp:156: undefined reference to `pthread_create'
/home/andresh/DVRTranslators/Boost/lib/libboost_thread-gcc41-mt-d.a(mute
x.o): In function `boost::try_mutex::do_trylock()':
/home/andresh/DVRTranslators/Boost/boost_1_34_1/libs/thread/src/mutex.cp
p:260: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
make: *** [listener] Error 1
I've used the Regex and Filesystem .a library files without a problem,
but the Thread .a library file won't work.
Here is my code:
#include