Boost logo

Boost Users :

Subject: Re: [Boost-users] undefined reference to Thread ( Newbie )
From: Nat Linden (nat_at_[hidden])
Date: 2013-07-04 14:08:40


On Thu, Jul 4, 2013 at 5:54 AM, Sahil Sachdeva <sahilsachdeva_at_[hidden]> wrote:

> I have linked using -lboost_thread and -L<path to boost>/bin.v2/libs.
> boost_system is also linked in the same manner.
>
> i am still getting the following linker errors:
>
> undefined reference to boost::thread::start_thread_noexcept()
> undefined reference to boost::thread::join_noexcept()
>
> I am using gcc 4.6.3 on Ubuntu 12.04 in eclipse.

You will have better luck getting help with Boost build problems, or
with Boost problems in general, if you post a small (!) source file
illustrating the failure, plus the exact command line you are using.
Without those, the mailing list can only guess.

That said... did you pass the -lboost_thread switch before the -L
switch, as implied by your description above? If so, try putting -L
before -l. gcc is pretty literal about processing its command line
left-to-right. Specifying -l before -L is like saying:

1. Look for libboost_thread.a in the places you already know about.
2. Look for any subsequent -l libraries to the right in <path to
boost>/bin.v2/libs.


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