Getting undefined reference to std::thread::_M_start_thread

后端 未结 1 618
抹茶落季
抹茶落季 2021-01-13 10:58

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:(.t         


        
相关标签:
1条回答
  • 2021-01-13 11:45

    Looks like a headers/libraries version mismatch. This is what I've got:

    $ nm -C /pkgs/gcc/4.9.2/lib/libstdc++.a | grep std::thread::_M_start_thread
    00000000 T std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>)
    
    $ nm -C /pkgs/gcc/5.2.0/lib/libstdc++.a | grep std::thread::_M_start_thread
    00000000 T std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>)
    00000000 T std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>, void (*)())
    
    $ fgrep -r M_start_thread /usr/intel/pkgs/gcc/4.9.2/include/
    /pkgs/gcc/4.9.2/include/c++/4.9.2/thread:        _M_start_thread(_M_make_routine(std::__bind_simple(
    /pkgs/gcc/4.9.2/include/c++/4.9.2/thread:    _M_start_thread(__shared_base_type);
    
    $ fgrep -r M_start_thread /usr/intel/pkgs/gcc/5.2.0/include/
    /pkgs/gcc/5.2.0/include/c++/5.2.0/thread:        _M_start_thread(_M_make_routine(std::__bind_simple(
    /pkgs/gcc/5.2.0/include/c++/5.2.0/thread:        _M_start_thread(_M_make_routine(std::__bind_simple(
    /pkgs/gcc/5.2.0/include/c++/5.2.0/thread:    _M_start_thread(__shared_base_type, void (*)());
    /pkgs/gcc/5.2.0/include/c++/5.2.0/thread:    _M_start_thread(__shared_base_type);
    
    0 讨论(0)
提交回复
热议问题