首页 > 编程语言 > 详细

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

时间:2017-04-21 20:36:51      阅读:1533      评论:0      收藏:0      [点我收藏+]

在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

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

原文:http://www.cnblogs.com/yangzifb/p/6745081.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!