2016-12-31 15 views
1

VS2015で新しいC++(空の)プロジェクトを作成し、ソリューションの 'inc'フォルダにEigen 3.3.1ソースコードを配置しました。例えば、Matrix.hへのパスがinc/Eigen/Core/であるようなdir。私はinc/パスを別のインクルードディレクトリとして設定していますが、ファイルにお互いの問題があった場合に別のインクルードディレクトリとしてinc/Eigen/を試しましたが、これは何も変わりません。新しいVisual StudioプロジェクトのEigen 3.3.1ファイルがコンパイルされない

#include "Eigen/Core/Matrix.h" 

int main() 
{ 
    return 0; 
} 

のx64用にコンパイルするときにこれは、私を与える:main.cppには

、私は以下の持っている

:Matrix.hのライン18文句

1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(18): error C2988: unrecognizable template declaration/definition 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(18): error C2143: syntax error: missing ';' before '<' 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(18): error C2059: syntax error: '<' 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(19): error C2143: syntax error: missing ';' before '{' 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(19): error C2447: '{': missing function header (old-style formal list?) 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(179): error C2143: syntax error: missing ',' before '<' 
1> c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(404): note: see reference to class template instantiation 'Eigen::Matrix<_Scalar,_Rows,_Cols,_Options,_MaxRows,_MaxCols>' being compiled 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(186): error C2143: syntax error: missing ';' before '<' 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(186): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(186): error C2238: unexpected token(s) preceding ';' 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(192): error C2653: 'Base': is not a class or namespace name 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(192): error C2144: syntax error: 'int' should be preceded by ';' 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(192): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(192): warning C4183: 'EIGEN_DENSE_PUBLIC_INTERFACE': missing return type; assumed to be a member function returning 'int' 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(192): error C3646: 'PlainObject': unknown override specifier 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(194): error C2653: 'Base': is not a class or namespace name 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(195): error C2653: 'Base': is not a class or namespace name 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(206): error C3646: 'EIGEN_STRONG_INLINE': unknown override specifier 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(206): error C3646: 'Matrix': unknown override specifier 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(206): error C2143: syntax error: missing ';' before '&' 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(206): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(207): error C2334: unexpected token(s) preceding '{'; skipping apparent function body 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(223): error C2061: syntax error: identifier 'EIGEN_STRONG_INLINE' 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(237): error C2334: unexpected token(s) preceding '{'; skipping apparent function body 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(243): error C2061: syntax error: identifier 'EIGEN_STRONG_INLINE' 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(259): error C2334: unexpected token(s) preceding ':'; skipping apparent function body 
1>c:\users\brody\documents\visual studio 2015\projects\eigentest\inc\eigen\core\matrix.h(14): fatal error C1075: the left brace '{' was unmatched at the end of the file 

#ifndef EIGEN_MATRIX_H 
#define EIGEN_MATRIX_H 

namespace Eigen { 

namespace internal { 
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols> 
struct traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > // line 18 
{ 
private: 
// etc... 

他のEigen #includeでも同様の問題が発生します。私はいくつかの必要な#includeの注文やいくつかのコンパイルフラグや設定を見逃しましたか?ありがとう!

答えて

0

サブフォルダだけでなく、Eigenディレクトリ全体をコピーする必要があります。また、srcサブフォルダのファイルを直接インクルードすることはできませんが、ファイルはEigenディレクトリに含めてください。たとえば#include <Eigen/Core>にはすべてのコア機能が含まれ、#include <Eigen/Dense>にはすべての高密度機能が含まれます(これにはコア、ジオメトリおよび分解が含まれます)。

関連する問題