gcc6.3编译c++11的程序链接opencv时字符型函数未…

2018-06-17 22:45:42来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

在Windows下编写图像处理程序,由于要使用regex,升级了mingw,编译c++11代码。之前代码中使用了opencv2.4.10,一直运行良好,升级编译器以后发现了错误:
undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
原因:
If you get linker errors about undefined references to symbols that involve types in the std::__cxx11 namespace or the tag [abi:cxx11] then it probably indicates that you are trying to link together object files that were compiled with different values for the _GLIBCXX_USE_CXX11_ABI macro. This commonly happens when linking to a third-party library that was compiled with an older version of GCC. If the third-party library cannot be rebuilt with the new ABI then you will need to recompile your code with the old ABI
Defining the following macro before including any standard library headers should fix your problem:
#define _GLIBCXX_USE_CXX11_ABI 0

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:bzoj2120&amp;&amp;2453 -- 带修改莫队

下一篇:读书笔记 effective c++ Item 52 如果你实现了placement new,你