#include <iostream>
#include<eigen3/Eigen/src/Core/Matrix.h> // does not define Eigen::StorageOptions
// need something like this
#include<eigen3/Eigen/src/ everything_in_here >
int main()
{
Eigen::Matrix<double,2,2> mat;
std::cout << mat(0,0) <<std::endl;
return 0;
}
In there, I’m trying to build a matrix object and it always asks 6 template parameters with error message:
wrong number of template arguments (3, should be 6)
So I started adding them, 4th one is Eigen::StorageOptions and is not defined in the Matrix.h header. Also there are too many headers to search. So, can I include all files in there with a single #include?
>Solution :
No, there isn’t. Only individual files can be included. (Though technically what that means is implementation-defined.) The preprocessor has no filesystem/directory concept. It considers the file names used in #include directives only as strings, not paths.
I am also not aware of any compiler extension to support this (although there may be ones).
You can generate the necessary #include directives in a script as a preparation step in the build process.