Reputation: 493
This seems to be the correct answer to my problem, however I think it's more the way I am writing my makefile as I already have the steps described in the link below (I know how to build things).
SASAGeometry.h:6:22: error: Eigen/Core: No such file or directory
SASAGeometry.h:7:20: error: Eigen/LU: No such file or directory
The problematic lines in my header file are simply :
#include <Eigen/Core>
#include <Eigen/LU>
So here is the makefile (am on overkill in the INCLUDE line, I know):
CC = g++
BIN = .
INCLUDE = -I/usr/local/include/eigen2/ -I. -I/usr/local/include/eigen2/Eigen/ -I/home/mark/Applications/eigen/Eigen/src/ -I /usr/local/include
CFLAGS = -pipe
LFLAGS = -lm
GeomTest_OBJS = geomTest.o SASAGeometry.o
geomTest_source = SASAGeometry.cpp SASAGeometry.h sasa_transformMatrix.cpp sasa_transformMatrix.h geomSetup.cpp
geomTest : $(GeomTest_OBJS) makefile
$(CC) -o geomTest.o -o SASAGeometry.o $(LIBS) $(INCLUDE) $(CFLAGS) $(geomTest_source) $(LFLAGS)
$(CC) $(LIBS) $(INCLUDE) $(CFLAGS) -o $(BIN)/geomTest geomTest.o SASAGeometry.o $(LFLAGS)
clean : \rm *.o *~ p1
any thoughts?
Thanks in advance!
Upvotes: 5
Views: 13833
Reputation: 1804
(Note, read comments to get gist of the final solution. I will update the answer when I have clarification from the original poster of the question.)
Sometimes it is the obvious, which is easy to miss. Please check that your user has read permissions for all files and directories in /usr/local/include/eigen2 and /usr/local/include/eigen2/Eigen. Also double check the files you are including actually exist in /usr/local/include/eigen2/Eigen.
Additional:
It sounds like the install was deployed directly into /usr/include/eigen2 and NOT /usr/include/Eigen like the documentation assumes. That means the header files the tutorials want are in /usr/include/eigen2. Your -I needs to point to /usr/include/
(I think thats by default in GNU GCC). Your source code is incorrect, it should be #include <eigen2/Core>
and #include <eigen2/LU>
. Whoever installed eigen on your system changed the name of the root directory specified in the documentations.
Upvotes: 5
Reputation: 1742
The question you link to has the correct answer. You just need to use the proper -I
flag to point to the Eigen headers. You should only need one -I
for all of the Eigen headers.
Upvotes: 1