title: "No Target Architecture" compilation error in Visual Studio using CMake
body: <p>I'm trying to compile my <code>C++</code> <code>CMake</code> project in <a href="https://visualstudio.microsoft.com" rel="nofollow noreferrer"><code>Visual Studio</code></a>. However, I'm getting the following error message:</p>
  
  <pre><code>#error:  "No Target Architecture"   C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CMakeLists.txt   C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winnt.h  154
  </code></pre>
  
  <p>I checked my code and I'm never including <code>winnt.h</code> but I'm including <code>windows.h</code> <a href="https://stackoverflow.com/a/4845893/3764804">so this rules out the solution of never including <code>winnt.h</code></a>.</p>
  
  <p>This is the <code>winnt.h</code> code snippet where it throws the error:</p>
  
  <pre><code>//
  // TODO: WOWXX - Unblock ARM. Make all alignment checks DWORD for now.
  //
  
  #define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( DWORD )
  #elif !defined(RC_INVOKED)
  #error "No Target Architecture"
  #endif
  </code></pre>
  
  <p>I've previously successfully compiled this project using <a href="https://nuwen.net/mingw.html" rel="nofollow noreferrer"><code>MinGW</code></a> and <code>WSL</code> (<code>Windows Subsystem for Linux</code>) outside of <code>Visual Studio</code>. How do I tell <code>Visual Studio</code> that my architecture is <code>64-bit</code> and <code>amd64</code> (?). What is necessary in addition to make it compile? The run configuration is set to <code>x64-Debug</code>. Including <code>stdafx.h</code> is not possible since the header file is not found. I'm also using <a href="https://www.boost.org" rel="nofollow noreferrer"><code>Boost</code></a> but that is resolved properly by adding the following line to my <code>CMakeLists.txt</code>:</p>
  
  <pre><code>set(BOOST_ROOT "C:/local/boost_1_69_0_b1_rc3")
  </code></pre>