码迷,mamicode.com
首页 > 其他好文 > 详细

openCV中 libopencv-nonfree-dev的安装: undefined reference to `cv::initModule_nonfree()'

时间:2015-08-06 22:27:45      阅读:343      评论:0      收藏:0      [点我收藏+]

标签:

今天照着一起做RGB-D SLAM (3)    ,
程序会出现下面的错误:
cv::initModule_nonfree();

/home/yhzhao/slam/src/detectFeatures.cpp:32: undefined reference to `cv::initModule_nonfree()‘

很奇怪,我在自己的libs文件夹里能够找到 libopencv_nonfree.so.2.4.9 .
但是在自己的cmake中

cmake 中 message("OpenCV_LIBS = ${OpenCV_LIBS}")
  OpenCV_LIBS = opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d

里面没有opencv_nonfree,多谢根哥提醒,再以下面方法安装了个库.给后来相同情况者提个醒.

sudo add-apt-repository --yes ppa:xqms/opencv-nonfree
sudo apt-get update
sudo apt-get install libopencv-nonfree-dev

安装后
cmake 中 message("OpenCV_LIBS = ${OpenCV_LIBS}")

OpenCV_LIBS = opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_nonfree;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d  

版权声明:本文为博主原创文章,未经博主允许不得转载。

openCV中 libopencv-nonfree-dev的安装: undefined reference to `cv::initModule_nonfree()'

标签:

原文地址:http://blog.csdn.net/zyh821351004/article/details/47322823

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