当前位置: 技术问答>linux和unix
移植opencv2.0时编译出错,请教如何修改。
来源: 互联网 发布时间:2016-09-18
本文导语: make[2]: Entering directory `/usr/tt/opencv/opencv-2.0.0/src' /bin/sh ../libtool --tag=CXX --mode=compile arm-linux-g++ -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -I../include/opencv -I/usr/include -O2 -fomit-frame-pointer -MT cxprecomp.lo -MD -MP -MF .deps/cxprecomp.Tpo...
make[2]: Entering directory `/usr/tt/opencv/opencv-2.0.0/src'
/bin/sh ../libtool --tag=CXX --mode=compile arm-linux-g++ -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -I../include/opencv -I/usr/include -O2 -fomit-frame-pointer -MT cxprecomp.lo -MD -MP -MF .deps/cxprecomp.Tpo -c -o cxprecomp.lo `test -f 'cxcore/cxprecomp.cpp' || echo './'`cxcore/cxprecomp.cpp
libtool: compile: arm-linux-g++ -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -I../include/opencv -I/usr/include -O2 -fomit-frame-pointer -MT cxprecomp.lo -MD -MP -MF .deps/cxprecomp.Tpo -c cxcore/cxprecomp.cpp -o cxprecomp.o
In file included from ../include/opencv/cxcore.hpp:2243,
from ../include/opencv/cxcore.h:2123,
from cxcore/_cxcore.h:60,
from cxcore/cxprecomp.cpp:43:
../include/opencv/cxoperations.hpp: In member function `void cv::Ptr::addref()':
../include/opencv/cxoperations.hpp:1442: error: there are no arguments to `__exchange_and_add' that depend on a template parameter, so a declaration of `__exchange_and_add' must be available
../include/opencv/cxoperations.hpp:1442: error: (if you use `-fpermissive', G++
will accept your code, but allowing the use of an undeclared name is deprecated)../include/opencv/cxoperations.hpp: In member function `void cv::Ptr::release()':
这是我在./configure后,make时的出错信息,说这里_exchange_add没有定义
我在源代码中找到这个函数的位置
template inline void Ptr::addref()
{ if(refcount) CV_XADD(refcount, 1);}
在一篇博客里有这样的解释
/////////////////////////////////////////////////////////////////////////////////
opencv 错误:_exchange_and_add
错误原因:因为自己windows系统中使用的是MinGW 3.4.5编译器,于是出现了C_XADD定义错误
解决办法:
1.打开 cxoperations.hpp (该文档在前文所编译出的存放文件vc2008->include->opencv中)
2.找到以下语句 (lines 67-68 in 2.0):
#else #include
#if __GNUC__ >= 4
3.更新该语句已参照__MINGW32__ 的新定义(在MinGW编译器中的定义, http://predef.sourceforge.net/precomp.html#sec31):
#else
#include
#if __GNUC__ >= 4 || __MINGW32__
/////////////////////////////////////////////////////////
按照他的解释,是与编译器有关了,如果这样
gcc3.4.1的宏定义应该怎样添加进去呢??
谢谢!!
|
最新的OpenCV 2.1.0要求Gcc 4.x的。你升级一下你的编译器再试试看
|
雨飞,请问你的问题解决了吗,我那个交叉编译时,也出现__exchange_and_add错误,修改了#if __GNUC__ >= 4 || __MINGW32__后,还是出现同样的错误。
|
内核够新的了
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。