Configuring C++ 11 Programs for Windows XP

By installing Visual Studio 2012 Update 1, you can use the C++11 language enhancements, compilers, libraries, and other features of Visual Studio 2012 to create apps that target Windows XP and Windows Server 2003, in addition to the operating systems that are already supported.

Note

You must install Visual Studio 2012 Update 1 to add support for Windows XP and Windows Server 2003.

Windows XP targeting experience

The Visual Studio 2012 - Windows XP (v110_xp) platform toolset that's included in Visual Studio 2012 Update 1 is a version of the Windows 7 SDK that was included in Visual Studio 2010, but it uses the Visual Studio 2012 C++ compiler. It also configures project properties to appropriate default values—for example, the specification of a compatible linker for down-level targeting. Only apps that are created by using the vs110_xp toolset support Windows XP and Windows Server 2003, but those apps can also supportWindows Vista, Windows 7, Windows Server 2008, Windows 8, and Windows Server 2012.

To target Windows XP

  1. In Solution Explorer, open the shortcut menu for your project, and then choose Properties.

  2. In the Property Pages dialog box for the project, under Configuration Properties, General, set the Platform Toolset property to Visual Studio 2012 – Windows XP (v110_xp).

C++ runtime support

In Visual Studio 2012 Update 1, the C Runtime Library (CRT), Standard Template Library (STL), Active Template Library (ATL), Concurrency Runtime Library (ConCRT), Parallel Patterns Library (PPL), Microsoft Foundation Class Library (MFC), and C++ AMP (C++ Accelerated Massive Programming) are updated to add runtime support for Windows XP and Windows Server 2003. For these operating systems, the supported versions are Windows XP Service Pack 3 (SP3) for x86, Windows XP Service Pack 2 (SP2) for x64, and Windows Server 2003 Service Pack 2 (SP2) for both x86 and x64.

These libraries are supported by the v110 and v110_xp platform toolsets, depending on the target platform:

Library

V110 (Windows Vista, Windows 7, Windows Server 2008, Windows 8, Windows Server 2012)

V110 (Windows Store apps)

V110_xp (Windows XP, Windows Server 2003)

CRT

X

X

X

STL

X

X

X

ATL

X

X

X

ConCRT/PPL

X

X

X

MFC

X

X

C++ AMP

X

X

Note

Apps that are written in C++/CLI and target the .NET Framework 4 run on Windows XP and Windows Server 2003.

Differences between the toolsets

Due to differences in platform and library support, the development experience for apps that use the v110_xp platform toolset is not as complete as for apps that use the Visual Studio 2012 (v110) platform toolset.

  • Remote debugging

    Remote Tools for Visual Studio 2012 don't support remote debugging on Windows XP or Windows Server 2003. To debug an app while it's running on Windows XP or Windows Server 2003, you can use a debugger from an older version of Visual Studio to debug them locally or remotely. This resembles the experience of debugging an app on Windows Vista, which is a runtime target of the v110 platform toolset, but not a remote debugging target.

  • Static analysis

    The v110_xp platform toolset doesn't support static analysis because the SAL annotations for the Windows 7 SDK and the Visual Studio 2012 libraries are incompatible. When you want to perform static analysis on an app that supports Windows XP or Windows Server 2003, you can temporarily switch the solution to target the v110 platform toolset to perform the analysis, and then switch back to the v110_xp platform toolset to build the app.

  • Debugging of DirectX graphics

    Because the Graphics Debugger does not support the Direct3D 9 API, it cannot be used to debug apps that use Direct3D on Windows XP or Windows Server 2003. However, if the app implements an alternate renderer that uses the Direct3D 10 or Direct3D 11 APIs, the Graphics Debugger can be used to diagnose problems with the use of those APIs.

  • Building HLSL

    By default, the v110_xp toolset does not compile HLSL source code files. To compile HLSL files, download and install the June 2010 DirectX SDK, and then set the project's VC directories to include it. For more information, see the "DirectX SDK Does Not Register Include/Library Paths with Visual Studio 2010" section of the June 2010 DirectX SDK download page.