Eigen library : compile error
-
Following code is at very beginning of "HessenbergDecomposition.h", which is a public library for calculating Eigen values. Source code cab be viewed at this link.
namespace Eigen
{
namespace internal
{
template struct HessenbergDecompositionMatrixHReturnType;
template struct traits > //line 21
{ //line 22
typedef MatrixType ReturnType;
};
}
//more code
}VC++ compiler says:
E:\...\Eigen/HessenbergDecomposition.h(21) : error C2143: syntax error : missing ';' before '<'
E:\...\Eigen/HessenbergDecomposition.h(21) : error C2059: syntax error : '<'
E:\...\Eigen/HessenbergDecomposition.h(21) : error C2065: 'MatrixType' : undeclared identifier
E:\...\Eigen/HessenbergDecomposition.h(22) : error C2143: syntax error : missing ';' before '{'
E:\...\Eigen/HessenbergDecomposition.h(22) : error C2447: missing function header (old-style formal list?)Is this c/c++ or UNIX/VC++ incompatible problem? How to fix the compile error? Thanks for code corrections.
-
Following code is at very beginning of "HessenbergDecomposition.h", which is a public library for calculating Eigen values. Source code cab be viewed at this link.
namespace Eigen
{
namespace internal
{
template struct HessenbergDecompositionMatrixHReturnType;
template struct traits > //line 21
{ //line 22
typedef MatrixType ReturnType;
};
}
//more code
}VC++ compiler says:
E:\...\Eigen/HessenbergDecomposition.h(21) : error C2143: syntax error : missing ';' before '<'
E:\...\Eigen/HessenbergDecomposition.h(21) : error C2059: syntax error : '<'
E:\...\Eigen/HessenbergDecomposition.h(21) : error C2065: 'MatrixType' : undeclared identifier
E:\...\Eigen/HessenbergDecomposition.h(22) : error C2143: syntax error : missing ';' before '{'
E:\...\Eigen/HessenbergDecomposition.h(22) : error C2447: missing function header (old-style formal list?)Is this c/c++ or UNIX/VC++ incompatible problem? How to fix the compile error? Thanks for code corrections.
-
Following code is at very beginning of "HessenbergDecomposition.h", which is a public library for calculating Eigen values. Source code cab be viewed at this link.
namespace Eigen
{
namespace internal
{
template struct HessenbergDecompositionMatrixHReturnType;
template struct traits > //line 21
{ //line 22
typedef MatrixType ReturnType;
};
}
//more code
}VC++ compiler says:
E:\...\Eigen/HessenbergDecomposition.h(21) : error C2143: syntax error : missing ';' before '<'
E:\...\Eigen/HessenbergDecomposition.h(21) : error C2059: syntax error : '<'
E:\...\Eigen/HessenbergDecomposition.h(21) : error C2065: 'MatrixType' : undeclared identifier
E:\...\Eigen/HessenbergDecomposition.h(22) : error C2143: syntax error : missing ';' before '{'
E:\...\Eigen/HessenbergDecomposition.h(22) : error C2447: missing function header (old-style formal list?)Is this c/c++ or UNIX/VC++ incompatible problem? How to fix the compile error? Thanks for code corrections.
The code is correct C++, except that this header file will only compile if included after Core, as it is in Eigenvalues:
#ifndef EIGEN_EIGENVALUES_MODULE_H
#define EIGEN_EIGENVALUES_MODULE_H#include "Core"
...
#include "src/Eigenvalues/HessenbergDecomposition.h"src/Eigenvalues/HessenbergDecomposition.h is not supposed to be included directly. What is the cpp file that you're trying to compile?