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

using eigen in Code::Blocks

Tags: None
(comma "," separated)
ric63
Registered Member
Posts
6
Karma
0
OS

using eigen in Code::Blocks

Mon Jan 09, 2012 6:26 pm
Hi all,
How I configure Code::Blocks for using Eigen3 library ?
thanks
bye
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: using eigen in Code::Blocks

Mon Jan 09, 2012 8:52 pm
I'm not a Code::Blocks user but all you have to do is to configure your project to add the path to Eigen's headers in the set of default include directories. E.g., if the Eigen/Core header is in:

/usr/local/eigen3/Eigen/Core

then you have to add the /usr/local/eigen3 folder.
ric63
Registered Member
Posts
6
Karma
0
OS

Re: using eigen in Code::Blocks

Tue Jan 10, 2012 9:13 am
hi,
thank you for reply.
I addeed path to eigen in:
1. project-> build options -> search directory -> compiler
2. project-> build options -> search directory -> Linker
3. project-> build options -> search directory -> resource compiler

but nothing, there are any errore:

Code: Select all
/home/ric/Documenti/temp/prova_ITcpp/prova_eigen/eigen/main.cpp|2|error: Eigen/Dense: Nessun file o directory|
/home/ric/Documenti/temp/prova_ITcpp/prova_eigen/eigen/main.cpp|4|error: ‘Eigen’ has not been declared|
/home/ric/Documenti/temp/prova_ITcpp/prova_eigen/eigen/main.cpp||In function ‘int main()’:|
/home/ric/Documenti/temp/prova_ITcpp/prova_eigen/eigen/main.cpp|8|error: ‘MatrixXd’ was not declared in this scope|
/home/ric/Documenti/temp/prova_ITcpp/prova_eigen/eigen/main.cpp|8|error: expected ‘;’ before ‘m’|
/home/ric/Documenti/temp/prova_ITcpp/prova_eigen/eigen/main.cpp|9|error: ‘m’ was not declared in this scope|
||=== Build finished: 5 errors, 0 warnings ===|



The file .cpp is:

Code: Select all
#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;
}


Why ?
manuels
Registered Member
Posts
47
Karma
0

Re: using eigen in Code::Blocks

Tue Jan 10, 2012 3:27 pm
What's the exact path that you included?
Note that you've got to include /path/where/eigen/is/ and not /path/where/eigen/is/Eigen/
ric63
Registered Member
Posts
6
Karma
0
OS

Re: using eigen in Code::Blocks

Tue Jan 10, 2012 4:00 pm
wonderful !!!
Work !!
Was this the problem.
Thank you
bye


Bookmarks



Who is online

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