我在这里https://docs.opencv.org/4.1.0/d2/de6/tutorial_py_setup_in_ubuntu.html的官方opencv发行版中安装Ubuntu18.04LTS中的OpenCV for Python
在创建构建目录并输入cmake ../之后,当我输入命令make时,会出现以下错误--之前我在Windows上使用过OpenCV。我是Ubuntu的新手。请帮帮忙。
In file included from /home/avi/opencv/modules/core/test/test_precomp.hpp:12:0,
from /home/avi/opencv/build/modules/core/opencv_test_core_pch_dephelp.cxx:1:
/home/avi/opencv/modules/core/include/opencv2/core/private.hpp:66:12: fatal error: Eigen/Core: No such file or directory
# include <Eigen/Core>
^~~~~~~~~~~~
compilation terminated.
modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/build.make:62: recipe for target 'modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.cxx.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.cxx.o] Error 1
CMakeFiles/Makefile2:1287: recipe for target 'modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
发布于 2019-07-21 23:38:09
转到/home/avi/opencv/modules/core/include/opencv2/core/private.hpp
文件。
将行:# include <Eigen/Core>
编辑为# include <eigen3/Eigen/Core>
从here上阅读有关此错误的更多信息。
发布于 2021-06-16 01:11:57
我没有在这篇文章中找到适合我的解决方案,所以如果有人来了,我不妨分享一下。
问题:当我安装Eigen3时,include正在寻找一个名为Eigen的include。
解决方案:创建一个软链接来创建一个名为Eigen的目录,该目录重定向到Eigen3。
sudo ln -s /usr/include/Eigurn3/Eigen /usr/include/Eigen
发布于 2021-06-14 16:36:32
看起来OpenCV
没有在它期望的地方找到Eigen
。假设您安装了Eigen
sudo apt-get install libeigen3-dev
最正确的方法是通过设置变量EIGEN_INCLUDE_PATH
(通常为\usr\include
)来指定OpenCV
安装Eigen
的位置,但请检查您的系统。
另一种选择,而不是编辑OpenCV代码,是在您安装Eigen的位置和OpenCV期望的位置之间创建一些链接:
cd /usr/include
sudo ln -sf eigen3/Eigen Eigen
sudo ln -sf eigen3/unsupported unsupported
https://stackoverflow.com/questions/57134411
复制相似问题