I have the following test program using eigen:
#include <iostream>
#include <Eigen/Dense>
using namespace std;
using Eigen::MatrixXd;
int main() {
MatrixXd m(2, 2);
m(0, 0) = 3;
m(1, 0) = 2.5;
m(0, 1) = -1;
m(1, 1) = m(1, 0) + m(0, 1);
cout << m << endl;
}
and I can compile it with g++ -I/usr/include/eigen3/ test1.cpp
.
However, the compile command doesn't work if I don't specify the include flag. This seems strange to me because I thought that any headers under /usr/include
will be picked up automatically by the compiler (e.g. Boost headers, also located under /usr/include
, work perfectly fine without having to tell the compiler where to look for them). What changes do I need to make to the eigen setup so I don't have to specify the -I flag in the compile command?