Boost unit test link error — abi mismatch?

坚强是说给别人听的谎言 提交于 2019-12-05 12:53:35

Add -D_GLIBCXX_USE_CXX11_ABI=0 to your CPPFLAGS, then recompile.

The libstdc++ that comes with gcc 5 had to make some changes to std::string and std::list for conformance with C++11. For backwards compatibility it supports a dual ABI, but it uses the new ABI by default.

Your libboost_unit_test_framework.so appears to be compiled without support for the new one (possibly with gcc 4.x), so when you compile your code, the compiler will generate code that expects to be linked against libraries supporting the new one. In cases where the two ABIs differ, symbols will be missing. Defining the _GLIBCXX_USE_CXX11_ABI macro to 0 makes gcc 5 use the old library code.

Alternatively, you could rebuild Boost.Test with gcc 5.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!