Skip to content

Error with #include <Eigen/core> when building opencv 4.1.1 #15157

@boitumeloruf

Description

@boitumeloruf
System information (version)
  • OpenCV => 4.1.1
  • Operating System / Platform => Linux Debian 9
  • Compiler => GCC 6.3.0
Detailed description

I encountered an error with #include <Eigen/core> when building OpenCV 4.1.1 even though Eigen is installed on the system and is found by cmake.

[ 1%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o In file included from /home/user/OpenCV/opencv-4.1.1/modules/imgproc/src/precomp.hpp:50:0, from /home/user/OpenCV/build/modules/imgproc/opencv_imgproc_pch_dephelp.cxx:1: /home/user/OpenCV/opencv-4.1.1/modules/core/include/opencv2/core/private.hpp:66:24: fatal error: Eigen/Core: No such file or directory # include <Eigen/Core>

Please find attached my CMakeCache.txt.

Temporary workaround that solved the issue:
Add -I<path-to-include/eigen3> to CMAKE_CXX_FLAGS.

Steps to reproduce
  1. Download code of OpenCV 4.1.1
  2. Build with configuration specified in CMakeCache.txt.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions