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

Newbie can't make it compile with GCC

Tags: None
(comma "," separated)
charmandwisdom
Registered Member
Posts
1
Karma
0
OS
Hello all,

I'm a newbie with Eigen2 and GCC 4.2.3 as well. I am currently having problems making gcc compile the examples from eigen2 and my 'hello world'-matrix examples.

According to the tutorial, installation is not required, nor CMake. However, When I installed the previous version (Eigen 1.0) through Ubuntu, I notice the header files were copied to the /include subdirectory.

Whenever I try to compile a program using a matrix, I get the message,
" error: Eigen/Core: file cannot be found".

Is it accurate what the tutorial on eigen.tuxfamily.org/dox.TutorialCore.html says? How is GCC aware of this classes? Does it really suffice to add "#include <Eigen/Core>" to the file that will use the matrix class? Shouldn't this class be installed?

I would really appreciate any help you may provide.

Cheers!!!

Bob.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
Well, this is really a very general question about GCC usage not specific to eigen. Basically, when you do
Code: Select all
#include<foo>

GCC looks for "foo" in a list of directories called the "include path". By default, this is only a few system directories like /usr/include, but you can add more with the -I option. So if you have eigen2 in a ~/eigen2 directory, just do:
Code: Select all
c++ -I ~/eigen2 myprogram.cpp


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!


Bookmarks



Who is online

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