undefined reference to Thread ( Newbie )

Hello all, I am trying to compile and use the Boost 1.54 libraries and have run into a dead end. I compiled and installed the libraries like mentioned in the documentation: ./bootstrap.sh./b2 install I even tried a complete reinstall using: ./bootstrap.sh./b2 threading=multi install 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. Does anyone know how i can fix this? Best, Sahil

On Thu, Jul 4, 2013 at 5:54 AM, Sahil Sachdeva
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.
participants (2)
-
Nat Linden
-
Sahil Sachdeva