码迷,mamicode.com
首页 > 编程语言 > 详细

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

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

标签:type   ror   window   uil   ble   including   ini   trying   处理   

在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时字符型函数未定义

标签:type   ror   window   uil   ble   including   ini   trying   处理   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!