Eigen installation seemed to work, but I still can't make eigen work

Solution 1:

The eigen3 header files go in a subdirectory /usr/include/eigen3 e.g.

/usr/include/eigen3/Eigen/Array
/usr/include/eigen3/Eigen/Cholesky
/usr/include/eigen3/Eigen/CholmodSupport
/usr/include/eigen3/Eigen/Core
/usr/include/eigen3/Eigen/Dense
/usr/include/eigen3/Eigen/Eigen

so you will need to specify the additional include path on your compiler command line, for example

g++ -std=c++11 -I/usr/include/eigen3 first_eigen.cpp -o my_exec

Alternatively (and possibly more portably), you can use the pkg-config database to automate the inclusion, i.e.

g++ -std=c++11 `pkg-config --cflags eigen3` first_eigen.cpp -o my_exec

Solution 2:

Change the include to

#include <eigen3/Eigen/Dense>