opencv: fatal error: Eigen/Core: No such file or directory
Hello,
I’ve:
- Read the documentation to build with the latest source
- No other person has already created the same issue with current build
- Using cut-n-paste below to the extent practical
- Reporting a single issue
System information (version)
matha@myUbuntu:~/projects/opencv/build$ uname -a Linux BeUlta 5.0.0-17-generic #18-Ubuntu SMP Tue Jun 4 15:34:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Detailed description
[ 14%] Building CXX object modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.cxx.o
In file included from /home/chowkidar/projects/opencv/modules/core/test/test_precomp.hpp:12,
from /home/chowkidar/projects/opencv/build/modules/core/opencv_test_core_pch_dephelp.cxx:1:
/home/chowkidar/projects/opencv/modules/core/include/opencv2/core/private.hpp:66:12: fatal error: Eigen/Core: No such file or directory
# include <Eigen/Core>
^~~~~~~~~~~~
compilation terminated.
make[2]: *** [modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/build.make:63: modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2715: modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
chowkidar@BeUlta:~/projects/opencv/build$
How to get past this error for the make command? (all steps performed documented in attachment).
Thanks. OpenCV installation.txt
P.S. I have built OpenCV on many platforms previously.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (2 by maintainers)
Links to this issue
Commits related to this issue
- update OpenCV 4.1.1 & CUDA 10.1 * fix build issue https://github.com/opencv/opencv/issues/14868 — committed to Borda/docker_python-opencv-ffmpeg by Borda 5 years ago
- update OpenCV 4.1.1 & CUDA 10.1 * fix build issue https://github.com/opencv/opencv/issues/14868 — committed to Borda/docker_python-opencv-ffmpeg by Borda 5 years ago
- update OpenCV 4.1.1 & CUDA 10.1 * fix build issue https://github.com/opencv/opencv/issues/14868 — committed to Borda/docker_python-opencv-ffmpeg by Borda 5 years ago
- update OpenCV 4.1.1 & CUDA 10.1 * fix build issue https://github.com/opencv/opencv/issues/14868 — committed to Borda/docker_python-opencv-ffmpeg by Borda 5 years ago
- update OpenCV 4.1.1 & CUDA 10.1 * fix build issue https://github.com/opencv/opencv/issues/14868 — committed to Borda/docker_python-opencv-ffmpeg by Borda 5 years ago
- update OpenCV 4.1.1 & CUDA 10.1 * fix build issue https://github.com/opencv/opencv/issues/14868 * apt fix-missing — committed to Borda/docker_python-opencv-ffmpeg by Borda 5 years ago
- Update include to prevent catkin_make build error https://github.com/opencv/opencv/issues/14868 /opt/ros/kinetic/include/grid_map_core/TypeDefs.hpp:10:22: fatal error: Eigen/Core: No such file or ... — committed to lchop/grid_map by lchop 4 years ago
- media-libs/opencv-4.1.2-r3: Fix build with dev-cpp/eigen-3.3.7-r1 References: https://github.com/opencv/opencv/issues/14868#issuecomment-664041088 — committed to devurandom/gentoo-overlay by devurandom 4 years ago
- media-libs/opencv-4.4.0: Fix build with dev-cpp/eigen-3.3.7-r1 This re-applies 9cab6197db89b165e5ce5995a397d1c8156904c2 after version bump. References: https://github.com/opencv/opencv/issues/14868#... — committed to devurandom/gentoo-overlay by devurandom 4 years ago
- Changed reference to the correct header file Including `Eigen/Core` was throwing errors. The correction was to edit the lines to include `eigen3/Eigen/Core`. Found from: https://github.com/opencv/open... — committed to shrinivas96/scan_inconsistency by shrinivas96 a year ago
goto your include directory see the tree. if the like mine… include/eigen3/Eigen and after that you can see Core files, so to fix it: edit your privte.hpp in the:
home/chowkidar/projects/opencv/modules/core/include/opencv2/core/private.hpp
edit the line:# include <Eigen/Core>
become:
# include <eigen3/Eigen/Core>
it should fix the problem
try
sudo ln -s /usr/include/eigen3/Eigen /usr/include/Eigen
relates #13337
Add
-DENABLE_PRECOMPILED_HEADERS=OFF
to CMake parameters (or disable EIGEN support or disable tests).this is working for me, thanks
Using default steps to download and install sources, changing the errant line to:
# include <eigen3/Eigen/Core>
solved my issue.Kind regards.
The root cause of the problem is incomplete support of precompiled headers. The best workaround is to turn them off:
-DENABLE_PRECOMPILED_HEADERS=OFF
.in cmake-gui click “add entry” then a in the pop up: “name:” EIGEN_INCLUDE_PATH" “type”:PATH “value”: /usr/local/include/eigen3
Then configure and generate, that should fix it.
I see this issue is closed but the problem in the current master remains. It does not build out-of-the-box even with Eigen3 available (on ubuntu 18.04).
Packagers might want to pass something like this to CMake:
-DEIGEN_INCLUDE_PATH="$(pkg-config --cflags-only-I eigen3 | sed 's/^-I//')"