This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Please Help - Extracting Eigen's codes in MSV Studio2010

Tags: None
(comma "," separated)
toycoming2u
Registered Member
Posts
11
Karma
0
OS
All,

I am just starting learning C++ using Microsoft Visual Studio2010 with some C# background.

I am struggling with importing Eigen3.03 into my source file folder. Since I am using academic department desktop, I am not allowed to extract Eigen codes into "include" folder under C:. Then only option is to extract Eigen into the same folder of my source file and utilize directive:

#include "Eigen\Dense"

Problems are:
- I start to confuse whether I should use Eigen\Dense(automatic generated by MSVD2010) or Eigen/Dense(used in Eigen tutorial). Anyway, I tried both, they complied but still aren't allow me to use Eigen feature (such as still can't declare MatrixXd). It says "Unidentified Identifier".

- I tried opening files that do not have extension such as Dense or Eigen from Eigen folder with MSVS but there is no automatic color code activated as normally happens with typical c++ file (basically, codes are in plain black color instead of green, red, etc.). This makes me unsure if these Eigen files are useable with my MSVS2010.

My best guess is "I am the one who is incapable to implement Eigen into my code". If anyone succeeds using Eigen with Microsoft Visual Studio2010, please kindly guide me through how to make this work.

Best,
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
you should use Eigen/Dense. Now if the #include worked, then perhaps you forgot the Eigen namespace:

Eigen::MatrixXd m;

or

using namespace Eigen;

MatrixXd m;
toycoming2u
Registered Member
Posts
11
Karma
0
OS
ggael wrote:you should use Eigen/Dense. Now if the #include worked, then perhaps you forgot the Eigen namespace:

Eigen::MatrixXd m;

or

using namespace Eigen;

MatrixXd m;


ggael,

It does work. How stupid, I am not aware of the namespace. Big thanks.

I also tried and found that MSVS2010 accept both #include Eigen/Dense and #include Eigen\Dense.

Before seeing your answer, I am actually working on converting all non-extension files into .h file and will try to #include with them. I think I probably do not need to do that now.

Again thanks.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]