Reputation: 129
How can I install the Eigen library in Visual C++ 2010? I downloaded the library from eigen.tuxfamily
But I do not know how can install it on my Visual C++. I want to run a program I downloaded and it has the following:
#include <Eigen/Core>
using namespace Eigen;
How can I do this? I have tried to look online but I seem to get confused. Could someone explain to me how I can do it?
Upvotes: 10
Views: 26567
Reputation: 9199
Eigen is mostly header-only library. All that you need is to add Eigen path to (MSVC2010):
Project Properties -> C/C++ -> General -> Additional Include Directories
Let's say you have header Core in folder C:/folder1/folder2/Eigen/, i.e.:
C:/folder1/folder2/Eigen/Core
So you should add path C:/folder1/folder2 to Additional Include Directories.
Upvotes: 15
Reputation: 78330
From the Eigen docs:
How to "install" Eigen?
In order to use Eigen, you just need to download and extract Eigen's source code (see the wiki for download instructions). In fact, the header files in the
Eigen
subdirectory are the only files required to compile programs using Eigen. The header files are the same for all platforms. It is not necessary to use CMake or install anything....
Compiling and running your first program
There is no library to link to. The only thing that you need to keep in mind when compiling the above program is that the compiler must be able to find the Eigen header files. The directory in which you placed Eigen's source code must be in the include path.
So you don't actually install anything.
Upvotes: 3