linux 下安装opencv3.0在编译时出现的问题undefined reference to `parallel_pthreads_set_threads_num(int)'
来源:互联网 发布:足彩平局分析软件 编辑:程序博客网 时间:2024/05/23 02:00
来自:http://blog.csdn.net/lyk_ffl/article/details/47683549
错误如下:
Linking CXX executable ../../bin/opencv_perf_core
在编译opencv 3.0 gold时,编译到大约37%时,出现
../../lib/libopencv_core.so.3.0.0: undefined reference to `parallel_pthreads_set_threads_num(int)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `parallel_pthreads_get_threads_num()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `parallel_for_pthreads(cv::Range const&, cv::ParallelLoopBody const&, double)'等好几个错误,困扰了好久,经多次尝试和不懈的坚持下,终于在github上找到了解决方法,现分享如下:
修改modules/core/src/parallel.cpp,添加7处删除5处(+表示要添加,-表示要删除)
132 namespace cv133 {
134 ParallelLoopBody::~ParallelLoopBody() {}
135 +#if defined HAVE_PTHREADS && HAVE_PTHREADS
136 + void parallel_for_pthreads(const cv::Range& range, const cv::ParallelLoopBody& body, double nstripes);
137 + size_t parallel_pthreads_get_threads_num();
138 + void parallel_pthreads_set_threads_num(int num);
139 +#endif
140 }
141
142 +
143 namespace
144 {
145 #ifdef CV_PARALLEL_FRAMEWORK
.
.
.
307 }
308
309 #elif defined HAVE_PTHREADS
- void parallel_for_pthreads(const Range& range, const ParallelLoopBody& body, double nstripes);
310 +
311 parallel_for_pthreads(range, body, nstripes);
312
313 #else
.
.
.
367
368 #elif defined HAVE_PTHREADS
369
- size_t parallel_pthreads_get_threads_num();
-
370 return parallel_pthreads_get_threads_num();
371
372 #else
.
.
.
428
429 #elif defined HAVE_PTHREADS
430
- void parallel_pthreads_set_threads_num(int num);
-
431 parallel_pthreads_set_threads_num(threads);
432
433 #endif
要是看的不方便的话,原始链接如下:
https://github.com/mshabunin/opencv/commit/1f983ec39c97298b0c8ce409a1cc229ecf14e55c?diff=unified
- linux 下安装opencv3.0在编译时出现的问题undefined reference to `parallel_pthreads_set_threads_num(int)'
- 解决编译opencv3.0时出现的问题undefined reference to `parallel_pthreads_set_threads_num(int)'
- Linux下基于opencv程序编译时,出现undefined reference to `cv::SIFT::SIFT(int, int, double, double, double)
- 【嵌入式Linux】[内核编译]:内核编译时出现的问题:undefined reference to `__gnu_mcount_nc'
- fedora 15 安装opencv2.2时出现undefined reference to `cvCreateCameraCapture_V4L(int)'问题及其解决方法
- linux下开发,解决cocos2d-x中编译出现的一个小问题, undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
- 在编译Faac1.28库时出现编译C++ 的undefined reference to '__cxa_end_cleanup'及 __gxx_personality_v0问题
- 编译U-boot 出现 undefined reference to `dm9000_initialize' 的问题
- gcc编译出现 undefined reference to 的问题
- gcc编译出现undefined reference to 的问题
- linux编译出现undefined reference to `pow‘的错误
- 在linux上编译cppunit1.12.1出现'undefined reference to `dlclose''的解决方法
- MySQL connector C++在Linux下编译undefined reference to 'get_driver_instance'问题
- linux下出现undefined reference to `mysql_init' 的解决方法
- ----linux--内核编译的问题:undefined reference to `printascii'
- android opencv3.0 jni 编译错误 undefined reference to `cvCvtColor'
- undefined reference to `__gnu_mcount_nc'的解决 在编译内核时出现了如下错误:
- PHP 5.3.10 编译安装时出现 undefined reference to `libiconv' 错误的解决方法
- 黑马程序员_单例设计模式
- WINDOWS下WAMP常用环境配置
- 线程池的基本使用
- C/C++中位运算杂谈
- 51Nod 1459 迷宫游戏
- linux 下安装opencv3.0在编译时出现的问题undefined reference to `parallel_pthreads_set_threads_num(int)'
- CALayer基础
- 用Canvas获取图像平均颜色
- 判断一个给定字符序列在可以由该序列字符组成的所有序列里按Lexical
- 学习Python (七)
- PHP基础知识
- 一个互联网+应用的创意
- 虚拟机下ubuntu gnome分辨率低的解决办法
- 安卓初学-让APP支持不同的屏幕(Supporting Different Screens)