Boost logo

Boost Users :

From: Meryl Silverburgh (silverburgh.meryl_at_[hidden])
Date: 2007-02-03 22:28:41


i have more information about my problem:

I have add '-L/usr/lib' as my library path during linking and i make
sure i have 'libboost_thread*' library in '/usr/lib', but it still
does not work. Any idea why?

g++ -L/usr/lib -o"sandbox" ./thread.o
./thread.o: In function `__tcf_1':../thread.cpp:9: undefined reference
to `boost::mutex::~mutex()'
./thread.o: In function
`__static_initialization_and_destruction_0':../thread.cpp:9: undefined
reference to `boost::mutex::mutex()'
./thread.o: In function `main':../thread.cpp:90: undefined reference
to `boost::thread::thread(boost::function0<void,
std::allocator<boost::function_base> > const&)'
:../thread.cpp:91: undefined reference to
`boost::thread::thread(boost::function0<void,
std::allocator<boost::function_base> > const&)'
:../thread.cpp:92: undefined reference to `boost::thread::join()'
:../thread.cpp:93: undefined reference to `boost::thread::join()'
:../thread.cpp:94: undefined reference to `boost::thread::~thread()'
:../thread.cpp:94: undefined reference to `boost::thread::~thread()'
:../thread.cpp:94: undefined reference to `boost::thread::~thread()'
:../thread.cpp:94: undefined reference to `boost::thread::~thread()'

here is my /usr/lib content:
$ ls -la libboost_thread.*
-rwxr-xr-x 1 root root 68644 Feb 16 2006 libboost_thread.a*
lrwxrwxrwx 1 root root 25 Jan 5 16:03 libboost_thread.so ->
libboost_thread.so.1.33.1*
-rwxr-xr-x 1 root root 43236 Feb 16 2006 libboost_thread.so.1.33.1*
lrwxrwxrwx 1 root root 25 Jan 5 16:03 libboost_thread.so.2 ->
libboost_thread.so.1.33.1*
$ pwd
/usr/lib

Thank you for any help.

On 2/3/07, Meryl Silverburgh <silverburgh.meryl_at_[hidden]> wrote:
> Hi,
>
> I am trying to compile the boost thread that I found here:
> http://www-eleves-isia.cma.fr/documentation/BoostDoc/boost_1_29_0/libs/thread/example/thread.cpp
>
> But i get the following error:
>
> Can you please tell me what do i need to do to fix it?
>
> ./thread.o: In function `main':../thread.cpp:27: undefined reference
> to `boost::thread::thread(boost::function0<void,
> std::allocator<boost::function_base> > const&)'
> :../thread.cpp:28: undefined reference to `boost::thread::join()'
> :../thread.cpp:28: undefined reference to `boost::thread::~thread()'
> :../thread.cpp:28: undefined reference to `boost::thread::~thread()'
> ./thread.o: In function `thread_alarm::operator()()':../thread.cpp:11:
> undefined reference to `boost::xtime_get(boost::xtime*, int)'
> :../thread.cpp:14: undefined reference to
> `boost::thread::sleep(boost::xtime const&)'
> collect2: ld returned 1 exit status
> make: *** [sandbox] Error 1
> make: Target `all' not remade because of errors.
> Build complete for project sandbox
>


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