gcc5.4 reports an undefined reference to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'

I encountered this problem when compiling ligra. I searched the Internet and found that it was the reason https://gcc.gnu.org/onlinedocs/libstdc%2B%2B/manual/using_dual_abi.html

In gcc5.4, C++11 parses some variables differently (the expression is not very good), for example, f std::list<int>is defined as std::__cxx11::list<int>, so there will be an undefined reference error.

The solution is to disable the relevant features of C++11 as follows: https://blog.csdn.net/ufolr/article/details/52669333

I am using predefined macros in compile options.

The method is very simple, add it directly in the Makefile option-D_GLIBCXX_USE_CXX11_ABI=0

gcc -std=c14 ........-D_GLIBCXX_USE_CXX11_ABI=0

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325067478&siteId=291194637