I'm building an app that uses a 3rd party lib (Box2D-MT) which I build from sources. When linking, I get this undefined reference error:
b2Threading.cpp:(.text._ZNSt6threadC2IM12b2ThreadPoolFviEJPS1_iEEEOT_DpOT0_[_ZNSt6threadC5IM12b2ThreadPoolFviEJPS1_iEEEOT_DpOT0_]+0xa4):
undefined reference to 'std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>, void (*)())'
I am building with g++ and link with
-lBox2D -lpthread -lrt -ldl -lstdc++
also, I am compiling with
-std=c++11
looking into libstdc++.a I can see a similar this symbol exists (it's "T"):
nm -C /usr/lib/gcc/x86_64-linux-gnu/4.9.2/libstdc++.a | grep _M_start_thread
0000000000000000 T std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>)
but this overload doesn't take a second parameter.
I've searched all the internet for something similar, but no one seems to have had this issue before (in any context).
Any hint on why I get this error and how I could solve it?
Looks like a headers/libraries version mismatch. This is what I've got: