qq_27426689
HSnb
采纳率0%
2017-03-24 09:56

opencv3.1.0交叉编译出错

我在给mini2440移植opencv3.1.0的时候,make编译opencv过程中出错了。log如下:

CMakeFiles/opencv_perf_core.dir/perf/perf_math.cpp.obj: In function cv::Mat::~Mat()':
perf_math.cpp.text._ZN2cv3MatD1Ev[cv::Mat::~Mat()]+0x1c): undefined reference to
__sync_fetch_and_add_4'
CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj: In function Size_MatType_CmpType_compare:erfTestBody()':
perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x30c): undefined reference to
__sync_fetch_and_add_4'
perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x378): undefined reference to __sync_fetch_and_add_4'
perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x3ec): undefined reference to
__sync_fetch_and_add_4'
CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj: In function Size_MatType_CmpType_compareScalar:erfTestBody()':
perf_compare.cpp.text._ZN34Size_MatType_CmpType_compareScalar12PerfTestBodyEv+0x32c): undefined reference to
__sync_fetch_and_add_4'
CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj:perf_compare.cpp.text._ZN34Size_MatType_CmpType_compareScalar12PerfTestBodyEv+0x3a0): more undefined references to `__sync_fetch_and_add_4' follow
collect2: ld returned 1 exit status
make[2]: *** [bin/opencv_perf_core] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make: *** [all] Error 2

我用的是Ubuntu14.04,32位虚拟机。
查网上说是CMAKE_C_FLAGS要设为-march=armv4t 可是我安装提示设置了CMAKE_C_FLAGS 和 CMAKE_CXX_FLAGS的值,错误还是没有消失。
我试过了opencv3.1。0和opencv3.2.0了,都会出现这个问题。因为项目需求要用到opencv3 所以只能自己编译最新版,,泪奔
有大神遇到过这个问题吗?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

相关推荐