I built boost using:
bjam --toolset=gcc --with-thread stage
Whenever I try to use Boost.Thread, I get undefined links, although I link to it. This does not happen with other Boost libraries such as Regex or System.
>g++ main.cpp -I. -L. -lboost_thread-mgw45-mt-1_46_1 C:\Users\jhasse\AppData\Local\Temp\ccjYfDox.o:main.cpp:(.text+0xf): undefined reference to `_imp___ZN5boost6thread20hardware_concurrencyEv' collect2: ld returned 1 exit status
Program Example:
#include <boost/thread.hpp> #include <iostream> int main() { std::cout << boost::thread::hardware_concurrency() << std::endl; }
What am I doing wrong?
source share