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

Compilation fails: Eigen with c++11 and mingw

Tags: None
(comma "," separated)
katakombi
Registered Member
Posts
18
Karma
0
Hi,

Ive got troubles to make Eigen compile under mingw-64.

Code: Select all
#include "Eigen/Dense"
#include <iostream>
int main() {
    Eigen::Matrix3d x,y;
    std::cout << x*y;
    return 0;
}


Code: Select all
g++ -IEigen test.cpp -o test
works
Code: Select all
g++ -std=c++11 -IEigen test.cpp -o test
fails with mingw, it works under linux though.
Code: Select all
Eigen/array:8:4 #error The Eigen/Array header does no longer exist in Eigen3. All that functionality has been moved to Eigen/Core...


Both times I used g++ 4.8.1
Edit: I use Eigen 3.2
Edit2: same issue when using VS 2012 Express

thanks for any help
jitseniesen
Registered Member
Posts
204
Karma
2
As the message says, you should not include the Eigen/Array header file (unless you are using the Eigen2 compatibility mode, which you are not). It looks like your Eigen directories somehow got messed up; perhaps there are some old files still lying around? Have a look at the file that includes <Eigen/Array>; that is probably the culprit. Or try removing all Eigen directories and downloading it again.
katakombi
Registered Member
Posts
18
Karma
0
jitseniesen wrote:As the message says, you should not include the Eigen/Array header file (unless you are using the Eigen2 compatibility mode, which you are not). It looks like your Eigen directories somehow got messed up; perhaps there are some old files still lying around? Have a look at the file that includes <Eigen/Array>; that is probably the culprit. Or try removing all Eigen directories and downloading it again.


I believed that at first, too. But the file is somewhere included. Also, it works if I omit the -std=c11++ switch, which means it is a problem which arises from using the C11 feature set.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
In your compilation flags you have -IEigen which is not a good idea because instead of including the standard <array> header file, it seems to include our deprecated Eigen/Array header. Recall that on windows filename are not case sensitive. For instance, using an absolute path should fix the issue.
katakombi
Registered Member
Posts
18
Karma
0
ggael wrote:In your compilation flags you have -IEigen which is not a good idea because instead of including the standard <array> header file, it seems to include our deprecated Eigen/Array header. Recall that on windows filename are not case sensitive. For instance, using an absolute path should fix the issue.


:< OFC! how could I not have thought of that... Thanks for another quick support :)
greets Stefan


Bookmarks



Who is online

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