Search code examples
c++compiler-errorseigeneigen3

Compile errors of Eigen's unsupported/CXX11/Tensor module


My project uses Eigen-3.3-beta. I can build my project in visual studio 2015 community which includes <Eigen/Core>. But after I include <unsupported\Eigen\CXX11\Tensor>, I got strange compile errors like these:

1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(46): error C3646: 'nLength': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(47): error C3646: 'lpSecurityDescriptor': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(47): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(48): error C3646: 'bInheritHandle': unknown override specifier
......
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(295): fatal error C1003: error count exceeds 100; stopping compilation

It seems that my project works properly with Eigen-3.3-beta's normal part except unsupported module. What's more, with unsupported module included, types introduced by GLEW (e.g. GLfloat) cannot be resolved. Did I do something wrong?


Solution

  • It seems this stems from the include of in <unsupported\Eigen\CXX11\Tensor>.

    I solved it with help from this thread (Compile error in 'winbase.h' ) and just exchanged line 38 in <unsupported\Eigen\CXX11\Tensor> from #include <winbase.h> with #include <windows.h>.

    Edit: This seems to be the way it was fixed in the lasted version in the repository.