Registered Member
|
Hi you all,
I've just included Eigen in many files of my project, but now I get this strange error in compilation time. I've checked that is disappears iff I don't include #include <Eigen/SVD> or any other Eigen module, such as <Eigen/QR> or <Eigen/Eigenvalues> ./eigen/Eigen/src/Eigenvalues/Tridiagonalization.h:259: error: 'T' was not declared in this scope ../eigen/Eigen/src/Eigenvalues/Tridiagonalization.h:259: error: template argument 1 is invalid ../eigen/Eigen/src/Eigenvalues/Tridiagonalization.h:314: error: expected initializer before '<' token ../eigen/Eigen/src/Eigenvalues/RealSchur.h:155: error: 'T' was not declared in this scope ../eigen/Eigen/src/Eigenvalues/RealSchur.h:155: error: template argument 1 is invalid ../eigen/Eigen/src/Eigenvalues/RealSchur.h:155: error: abstract declarator 'const _MatrixType&' used as declaration ../eigen/Eigen/src/Eigenvalues/RealSchur.h:155: error: expected ';' before '(' token ../eigen/Eigen/src/Eigenvalues/RealSchur.h:178: error: expected `;' before 'RealSchur' ../eigen/Eigen/src/Eigenvalues/EigenSolver.h: In member function 'Eigen::EigenSolver<MatrixType>& Eigen::EigenSolver<_MatrixType>::compute(const _MatrixType&, bool)': ../eigen/Eigen/src/Eigenvalues/EigenSolver.h:370: error: 'T' was not declared in this scope ../eigen/Eigen/src/Eigenvalues/EigenSolver.h:370: error: expected primary-expression before ')' token ../eigen/Eigen/src/Eigenvalues/ComplexSchur.h: At global scope: ../eigen/Eigen/src/Eigenvalues/ComplexSchur.h:171: error: 'T' was not declared in this scope ../eigen/Eigen/src/Eigenvalues/ComplexSchur.h:171: error: template argument 1 is invalid ../eigen/Eigen/src/Eigenvalues/ComplexSchur.h:171: error: abstract declarator 'const Eigen::Matrix<std::complex<typename Eigen::NumTraits<typename Derived::Scalar>::Real>, Eigen::ComplexSchur<_MatrixType>::RowsAtCompileTime, Eigen::ComplexSchur<_MatrixType>::ColsAtCompileTime, Eigen::ComplexSchur<_MatrixType>::Options, Eigen::ComplexSchur<_MatrixType>::MaxRowsAtCompileTime, Eigen::ComplexSchur<_MatrixType>::MaxColsAtCompileTime>&' used as declaration ../eigen/Eigen/src/Eigenvalues/ComplexSchur.h:171: error: expected ';' before '(' token ../eigen/Eigen/src/Eigenvalues/ComplexSchur.h:196: error: expected `;' before 'ComplexSchur' ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h: In member function 'Eigen::ComplexEigenSolver<MatrixType>& Eigen::ComplexEigenSolver<_MatrixType>::compute(const _MatrixType&, bool)': ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h:262: error: 'T' was not declared in this scope ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h:262: error: expected primary-expression before ')' token ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h: In member function 'void Eigen::ComplexEigenSolver<_MatrixType>::doComputeEigenvectors(typename Eigen::NumTraits<typename Derived::Scalar>::Real)': ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h:288: error: 'T' was not declared in this scope ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h:288: error: template argument 1 is invalid ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h:290: error: 'T' cannot appear in a constant-expression ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h:290: error: template argument 1 is invalid ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h:291: error: 'T' cannot appear in a constant-expression ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h:291: error: template argument 1 is invalid ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h:291: error: 'T' cannot appear in a constant-expression ../eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h:291: error: template argument 1 is invalid Mac OSX Leopard 10.5.8 g++ --version: i686-apple-darwin9-g++-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493) Eigen 3.0 beta2 very strange. This is the code of a KernelPCA dimensionality reduction class: ######### KernelPCA.cpp ###### #include "KernelPCA.h" #include <Eigen/Core> //#include <Eigen/SVD> // why can't I include SVD??? KernelPCA::KernelPCA() { } ######### KernelPCA.h ###### #ifndef _KERNELPCA_H_ #define _KERNELPCA_H_ #include "DimensionalityReduction.h" using namespace std; class KernelPCA : public DimensionalityReduction { private: GraphLayout *g; double epsilon; // create an edge iff ||x_i - x_j|| < epsilon int kappa; // choose the K-nearest neighbors public: KernelPCA(); }; #endif Thank you! |
Registered Member
|
First I had to include <Eigen/SVD> and then my specific headers files...
|
Moderator
|
Perhaps you should check that the header files you include before Eigen does not define **** macros...
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient