ubuntu下OpenCV2.4.13安装报错

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/weixin_44401286/article/details/102532339

<1>错误现象 cmake … 时发生报错

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
opencv_dep_CUDA_nppi_LIBRARY
    linked by target "opencv_core" in directory /home/bruce/software/opencv-2.4.13.6/modules/core
    linked by target "opencv_core" in directory /home/bruce/software/opencv-2.4.13.6/modules/core
    linked by target "opencv_core" in directory /home/bruce/software/opencv-2.4.13.6/modules/core
    linked by target "opencv_test_core" in directory /home/bruce/software/opencv-2.4.13.6/modules/core

<2>解决办法
打开cmake-gui,去掉对cuda的选项
在这里插入图片描述

<3>报错现象 在make -j4时发生报错

[100%] Building CXX object modules/contrib/CMakeFiles/opencv_contrib.dir/src/selfsimilarity.cpp.o
/home/bruce/software/opencv-2.4.13.6/modules/contrib/src/rgbdodometry.cpp:65:47: fatal error: unsupported/Eigen/MatrixFunctions: 没有那个文件或目录
compilation terminated.
modules/contrib/CMakeFiles/opencv_contrib.dir/build.make:710: recipe for target 'modules/contrib/CMakeFiles/opencv_contrib.dir/src/rgbdodometry.cpp.o' failed
make[2]: *** [modules/contrib/CMakeFiles/opencv_contrib.dir/src/rgbdodometry.cpp.o] Error 1
make[2]: *** 正在等待未完成的任务....
[100%] Linking CXX executable ../../bin/opencv_test_stitching
CMakeFiles/Makefile2:5876: recipe for target 'modules/contrib/CMakeFiles/opencv_contrib.dir/all' failed
make[1]: *** [modules/contrib/CMakeFiles/opencv_contrib.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[100%] Built target opencv_test_stitching
[100%] Linking CXX executable ../../bin/opencv_perf_stitching
[100%] Built target opencv_perf_stitching
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

<4>解决办法

根据错误提示/home/bruce/software/opencv-2.4.13.6/modules/contrib/src/rgbdodometry.cpp
找到该cpp文件,进行修改。
# include <unsupported/Eigen/MatrixFunctions>

替换为把eigen3安装库的路径加进去,如下:

#  include </usr/local/include/eigen3/unsupported/Eigen/MatrixFunctions>

猜你喜欢

转载自blog.csdn.net/weixin_44401286/article/details/102532339