Targeting Windows XP with C++ in Visual Studio 2012

Targeting Windows XP with C++ in Visual Studio 2012

Rate This
  • Comments 53

We recently announced the Visual Studio 2012 product lineup and platform support, and as a part of this announcement we mentioned that we were evaluating options for enabling C++ developers to build applications in Visual Studio 2012 that run on Windows XP without requiring side-by-side installation of Visual Studio 2010. Today I would like to share more details about this capability.

Background
The C++ runtime and libraries that accompany Visual Studio 2012 contain dependencies on several Windows API functions that exist only on Windows Vista and higher versions of the OS.  This means that applications built with Visual Studio 2012’s C++ compiler will fail to load and execute on Windows XP. Developers wishing to target Windows XP can use Visual Studio’s C++ multi-targeting feature, which enables the use of the Visual Studio 2010 compiler from within the new IDE. Multi-targeting enables developers to take advantage of the new features of the IDE without migrating projects to the new compiler or to use the Visual Studio 2010 compiler to build applications that target Windows XP.

Assessing Multi-targeting
The Beta release of Visual Studio 2012 offered us an opportunity to evaluate the effectiveness of C++ multi-targeting, particularly among developers that wish to target Windows XP. Feedback from customers cited two key scenarios they wanted Visual Studio 2012 to support in order to best meet their needs for Windows XP targeting:

  1. The ability to target Windows XP and higher from a single compiler and tools chain rather than resort to separate builds for XP and for Vista+.
  2. The ability to target Windows XP and higher from a single code base that employs modern C++11 language features.

In order to better meet customer needs relative to build configuration and XP targeting, we have made the decision to enhance multi-targeting to support Windows XP targeting directly from the Visual Studio 2012 C++ compiler and libraries.

Enhancing Multi-targeting
Later this fall, Microsoft will provide an update to Visual Studio 2012 that will enable C++ applications to target Windows XP. This update will make the necessary modifications to the Visual C++ 2012 compiler, runtime, and libraries to enable developers to create applications and DLLs that run on Windows XP and higher versions as well as Windows Server 2003 and higher. This update will also be included in the recently-announced Visual Studio Express 2012 for Windows Desktop.

Steve Teixeira
Director of Program Management
Visual C++

Leave a Comment
  • Please add 4 and 5 and type the answer here:
  • Post
  • we appreciate your decision to reintroduce targeting Windows XP with VC++2012 and we hope that it will be released soon after the RTM of VC+2012

  • Great news! I will be looking forward to this post-RTM update!  Thanks to everyone that helped push Microsoft in the right direction on this one.  

  • Hey, a vcblog post that will actually get _positive_ feedback for a change. ;-]

    Thanks a bunch, Steve.

  • Nice one. Thanks for listening.

    Still not sure what the original thinking was here (or with several other choices in VS2012 and Win8 in general) but it's good to know things aren't set in stone, in some cases at least.

  • Yahoo!!  Thanks for listening and changing direction on this one.

    I notice you didn't mention MFC specifically, but I assume this is one of the C++ libraries that will also be updated to support XP targeting in VS 2012.

  • Thank you for listening to all of our feedback.  I'm confused about why you're still calling it Multi-targeting though.  Isn't it just going to be an update to the default compiler and libraries?

  • Great to see that you listen to customer feedback! First you brought back VS2012 Express and now you bring back XP support. Thank you! Much appreciated!

  • Such a great news ! Thanks a lot for listening to us !

  • Finally! Now all we need is something to relieve the grayness.

    What's the news on the inclusion of a Visual Studio "classic" (VS2010/2008) theme as an alternative to "light" and "dark"?

  • Later is better than never.

    I hope DevDiv takes the community's response to ignoring customers' requirements for targeting legacy XP systems with C++11 and a modern toolchain and the Express for Desktop apps debacle to heart and avoids having to make these flip-flop decisions when it is too late for RTM in the future.

    The refusal to implement the modern ISO C standards (C11 or even C99) remains as do the terrible all caps menus in the IDE, but I suppose we should count our blessings.

  • @Anna-Jayne : Presumably the Visual Studio Color Theme Editor will be updated for VS2012: visualstudiogallery.msdn.microsoft.com/20cd93a2-c435-4d00-a797-499f16402378

  • I give you props for listening to your customers and course-correcting.  That said, I share GregM's confusion, if it's possible to write C++ 11 code and have it run on XP and up, why would you call it multi-targetting?

  • Super-kudos on remembering VS Express!

  • Good. Next step: release an update to Windows 8 allowing to get rid of Metro altogether. Trust us: we'll ask loudly and clearly until it happens. Then your telemetry will tell you how bad an idea it was in the first place for desktop PCs.

  • Nice to hear that there's a bit of sanity left :-)

    Now, can you remove the silly 'feature' of LINK.EXE where it refuses to set arbitrary PE ImageVersions? When using a custom-built libc, it kinda sucks having to use old linkers (or post-link exe patching) to get binaries running on win2k. Yes, some of us still support prehistoric windows versions.

Page 1 of 4 (53 items) 1234