title: How to compile code for Windows XP in Visual Studio 2017
body: <p>I was trying to compile a basic hello world program for Windows XP in Visual Studio 2017 on Windows 10. But it was giving some errors as showing in the image. </p>
  
  <p>I already tried the steps mentioned in other Stack Overflow posts on this question, and changed the Platform tools "Visual Studio 2017 - Windows XP (v141_xp)" .</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  int main() {
      cout &lt;&lt; "Hello world\n";
  }
  </code></pre>
  
  <pre><code>1&gt;------ Build started: Project: WindowsProject1, Configuration: Debug Win32 ------
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141_xp\Toolset.targets(39,5): warning MSB8051: Support for targeting Windows XP is deprecated and will not be present in future releases of Visual Studio. Please see https://go.microsoft.com/fwlink/?linkid=2023588 for more information.
  1&gt;stdafx.cpp
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.1a\include\objbase.h(239): error C2760: syntax error: unexpected token 'identifier', expected 'type specifier'
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.1a\include\gdiplusheaders.h(891): error C4596: 'EmfToWmfBits': illegal qualified name in member declaration
  1&gt;c:\program files (x86)\microsoft sdks\windows\v7.1a\include\gdiplusstringformat.h(220): error C4596: 'GetTrimming': illegal qualified name in member declaration
  1&gt;Done building project "WindowsProject1.vcxproj" -- FAILED.
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  
  </code></pre>