VTK failed when build with permissive- + MSVC on windows
Hi,
I tried to build VTK with permissive- on Windows(VS2017 latest revision). It failed due to the error C2589. Could you please help take a look at this? Thanks!
The file: VTK/src/RenderingOpenGL2/vtkOpenGLRenderWindow.cxx has an incorrectly sequenced header inclusion, the "vtk_glew.h" is a third-party library to VTK and it-itself includes windows.h prematurely. Probably fix: Was: #include "vtk_glew.h" #include "vtkOpenGLRenderWindow.h"
Should be: #include "vtkOpenGLRenderWindow.h" #include "vtk_glew.h"
Repro
- git clone https://gitlab.kitware.com/vtk/vtk.git D:\VTK\src
- Open a VS 2017 x86 command prompt and browse to D:\VTK
- Set _CL_=/permissive-
- mkdir build_x86 && pushd build_x86
- cmake -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_VERSION=10.0.16299.0 -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DBUILD_EXAMPLES=OFF -DVTK_IGNORE_CMAKE_CXX11_CHECKS=TRUE ..\src"
- msbuild /m /p:Configuration=Release;Platform=Win32 All_BUILD.vcxproj /t:Rebuild"
Failures: d:\vtk\src\common\core\vtkBuffer.h(156): error C2589: '(': illegal token on right side of '::'