Reputation: 113
I downloaded the latest version and did the method2 exactly as described in its readme file:
Method 1. Installing without using CMake
****************************************
You can use right away the headers in the Eigen/ subdirectory. In order
to install, just copy this Eigen/ subdirectory to your favorite location.
If you also want the unsupported features, copy the unsupported/
subdirectory too.
Method 2. Installing using CMake
********************************
Let's call this directory 'source_dir' (where this INSTALL file is).
Before starting, create another directory which we will call 'build_dir'.
Do:
cd build_dir
cmake source_dir
make install
and the terminal shows it correctly installed and from the eclipse include folder I can see it is installed in usr/local/include,
but when I compile the following test program in eclipse, I got this:
#include <iostream>
#include <Eigen/Dense>
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);
std::cout << m << std::endl;
}
Please help me out thanks!
Upvotes: 0
Views: 3393
Reputation:
This illustrates a problem with some Eigen installations: the headers are placed in a subdirectory called "eigen3" in the include folder, which means that your include statement would have to be:
#include <eigen3/Eigen/Dense>
which isn't recommended but would work.
You should, instead, (1) add the eigen3 folder to your include path and then, in your code, leave the include statement as #include <Eigen/Dense>
.
Alternatively, you could either (2) move the Eigen folder in eigen3 up one level, or (3) move the Eigen folder somewhere else and set your include path properly. In either case your code would have #include <Eigen/Dense>
.
#1 above is the recommend approach.
Upvotes: 2