|
Boost Users : |
Subject: [Boost-users] (newbie) boost thread compile problems on Fedora 8
From: Kishalay Kundu (kishalay.kundu_at_[hidden])
Date: 2009-07-16 08:56:44
Hi,
I am having trouble compiling a correct version of the boost thread
library on a x86_64 Fedora Core 8 and was wondering if anyone can help
me out. I've tried both version 1.37 and 1.39. I describe below what I
do and what happens after that.
I am on an AMD64 Fedora Core 8 platform (with gcc 4.1.2 and glibc 2.7)
that already had boost 1.34 on it at /usr/lib level. I erased that
version by deleting all the libraries and moving 'boost' directory in
/usr/include to 'boost_1-34' directory. I download the .gz tarball,
bootstrap it, make it (with make for 1.37 and bjam for 1.39) and
install it to /usr/local/lib. The compilation goes without a hitch
(except for some warnings for boost serialization and others, but not
for thread). I have both .a and .so files generated and residing in
/usr/local/lib and boost include files in /usr/local/include. I add
the links libboost_thread-mt.a and libboost_thread-mt.so to point to
libboost_thread-gcc41-mt_1.3x.* libs.
Now, I write a small test program (given below). It gives me linker
errors with undefined references to pretty much every pthread symbol.
If anyone wants I can paste all the errors in the next message. When I
add the -lpthread flag to the compile, it gives me an undefined
reference error with regards to __vdso_clock_gettime from
/lib64/libpthread.a.
I'm not sure where exactly the problem lies and would greatly
appreciate if someone could point me in the right direction. Thank
you.
regards,
Kishalay
My test program: compiled with: gcc -o testk test.cpp -lboost_thread-mt
#include <cstdio>
#include <cstdlib>
#include <boost/thread.hpp>
using namespace std;
using namespace boost;
static void somefunc( )
{
printf( "thread calling this\n" );
}
int
main( int argc, char** argv )
{
boost::thread* t = new thread( somefunc );
delete t;
}
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