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)

Commits related to this issue

Most upvoted comments

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).

try sudo ln -s /usr/include/eigen3/Eigen /usr/include/Eigen

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//')"