# Errors during compilation of VTK 7.1.1 and 8.2 using VS2017

**URL:** https://discourse.vtk.org/t/errors-during-compilation-of-vtk-7-1-1-and-8-2-using-vs2017/269
**Category:** Development
**Created:** [February 13, 2019, 12:04pm UTC](https://discourse.vtk.org/t/errors-during-compilation-of-vtk-7-1-1-and-8-2-using-vs2017/269 "2019-02-13T12:04:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![LvR](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/f17d59/32.png) [@LvR](https://discourse.vtk.org/u/LvR)
#### Post date: [February 13, 2019, 12:04pm UTC](https://discourse.vtk.org/t/errors-during-compilation-of-vtk-7-1-1-and-8-2-using-vs2017/269/1 "2019-02-13T12:04:11Z")

</div>

Last month I switched to Visual Studio 2017. So I also switched from VTK7.1 to VTK 8.2. But after trying several settings in CMake, I did not manage to compile VTK 8.2 successfully.

So I switched back to VTK 7.1.1. But to my surprise, this version also did not compile.  
So I started analyzing the errors. And after applying three small tweaks in my Visual Studio code I was able to compile VTK 7.1.1. And after that version 8.2 also compiled flawlessly.

Of course I rather changed the VTK code, but I have no idea which parts of VTK have to be changed.

Here are the tweaks that I applied:  
In winnt.h:  
Line 154: the compiler stopped after the text: #error “No Target Architecture”  
I solved this by adding the line: #define _AMD64_ before this line  
Line 20583: the compiler stumbled over: const VOID\* None, because the word None was defined as 0L.  
I solved this by adding the lines #undef None before and #define None 0L after this statement.

In processthreadapi.h:  
Line 1034: The compiler stopped after the text: ULONG ControlMask, because ControlMask was allready defined as (1\<\<2).  
Solved by adding the #undef ControlMask before and #define ControlMask (1\<\<2) after this line.

So if somebodies knows where these names are defined, can you please make the appropriate changes. So I can download and compile the updated version and undo the tweaks in my Visual Studio.
