cmake找到opencv库的路径,但make找不到opencv函数Rodrigues

时间:2017-08-30 06:17:03

标签: c++ opencv makefile build cmake

我正在从github建立一个项目。该项目使用OpenCVcmake用于构建项目。 cmake的输出如下:

OpenCV information:
  OpenCV_INCLUDE_DIRS: /usr/local/anaconda3/envs/test-caffe/include/opencv;/usr/local/anaconda3/envs/test-caffe/include
  OpenCV_LIBRARIES: opencv_xphoto;opencv_xobjdetect;opencv_ximgproc;opencv_xfeatures2d;opencv_tracking;opencv_text;opencv_surface_matching;opencv_structured_light;opencv_stereo;opencv_saliency;opencv_rgbd;opencv_reg;opencv_plot;opencv_optflow;opencv_line_descriptor;opencv_hdf;opencv_fuzzy;opencv_face;opencv_dpm;opencv_dnn;opencv_datasets;opencv_ccalib;opencv_bioinspired;opencv_bgsegm;opencv_aruco;opencv_videostab;opencv_videoio;opencv_video;opencv_superres;opencv_stitching;opencv_shape;opencv_photo;opencv_objdetect;opencv_ml;opencv_imgproc;opencv_imgcodecs;opencv_highgui;opencv_flann;opencv_features2d;opencv_core;opencv_calib3d
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   filesystem
--   system
Boost information:
  Boost_INCLUDE_DIRS: /usr/include
  Boost_LIBRARIES: /usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_system.so
  Boost_LIBRARY_DIRS: /usr/lib/x86_64-linux-gnu
OPENMP FOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /home/iimtech5/3DMM/3dmm_cnn-master/build

如您所见,cmake找到了opencv个目录。但这是make命令抛出的错误:

/home/iimtech5/3DMM/3dmm_cnn-master/modules/PoseExpr/src/BaselFaceEstimator.cpp:207:2: error: ‘Rodrigues’ is not a member of ‘cv’
cv::Rodrigues(rMatP, rVec);
  ^
make[2]: *** [modules/PoseExpr/CMakeFiles/PoseExprLib.dir/src/BaselFaceEstimator.cpp.o] Error 1
make[1]: *** [modules/PoseExpr/CMakeFiles/PoseExprLib.dir/all] Error 2
make: *** [all] Error 2

任何人都可以建议我为什么会出现这个错误?我已经尝试了所有方法来了解这个错误的含义但是失败了。

提前致谢。

1 个答案:

答案 0 :(得分:1)

确保在linux上安装了openCV: OpenCV_INCLUDE_DIRS:/ usr / local / anaconda3 / envs / test-caffe / include / opencv; / usr / local / anaconda3 / envs / test-caffe / include

以上路径适用于python中的opencv

使用以下命令安装opencv:sudo apt-get install libopencv-dev