Targeting Windows XP with C++ in Visual Studio 2012
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.
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:
- 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+.
- 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.
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.
Director of Program Management
Start Here
Join the conversation
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.
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.
Thank goodness. This change and Express for Desktop were the two things that absolutely Had To Happen in this release cycle. Suddenly, Visual Studio 2012 is a viable option again. Without this change, I would not have bought the product; now, I will.
Thanks Steve, good news indeed!
Why is it called multi-targeting and not direct support?
In vs 2012 will there be two sets of binaries?
If so, will this second set of "XP" binaries support vista and win 7 too?
Great news – pity it took so long and that we'll have to wait for it.
As for the ALL CAPS, someone thankfully made it optional…
Create this value:
REG_DWORD value: 1
Then restart VS.
This is good news. Question: Which Windows XP/2k3 Service pack levels will be supported?
This is fantastic news, without XP support VS 2012 is a Metro only compiler.
What Service Pack level of XP will you support, hopefully SP0?
How about targeting Windows 2000 and under with Visual C++ 2012? I got a lot of legacy systems to support that cannot afford to be upgraded to modern systems.
Wonderful news, now we can use VS2012 before August 2014 when Windows XP finially goes to its rest :-)
Thank you for enabling this!
Thank you. Although I don't understand why you made these stupid decisions in the first place… Please use your brains next time.
Anyway, thanks again! The open source community will greatly appreciate this and VS2010 Express for desktop!
Also, I am also interested to know why this is called multi-targeting and would also appreciate info on supported SP levels. Thanks!
Great news! Looking forward to being able to migrate to the new compiler.
Now we are waiting for full C++11 support! =)
We really appreciate it, and I think Microsoft's financial officers and share holders will appreciate it too.
(Without XP support, only a few companies would have been able to buy and use it).
Wow 2 good announcements in the last few days – vc express desktop support and now XP support. thanks for listening to feedback.
Thanks,supporting xp is a must,because customers are still using it.
Fantastic! All of a sudden Vs 2012 is a viable option for us again. When XP support is added back in we will almost surely update. Not until then though. Please don't wait too long – we really want to start using some of the newer C++ language features in our code. Thanks Steve!
Now we wait for your out-of-band updates to the VC++2012 compiler…
Thank you for restoring some measure of confidence within the VC++ dev community.
This is certainly the right decision, and I'm glad a course correction was made.
OMG. I never in my wildest dreams imagine that MS would back down and change their decision about this.
They actually listen to feedback. I have a hard time believing that this happen.
Im now exited about VS2012 again, and looking forward to using it.
Excellent. Thank you. The road ahead just got a lot clearer.
Great. Now I can write code for the morons still running a 10-year-old OS. Why not bring back Windows 3.1 support as well?
Oh my god. I don't want to sound harsh, but this is the first truly requested "feature" of VC2012! Not to mention the gradual inclusion of more C++11x features, which makes it the SECOND thing we will get!
"Now I can write code for the morons still running a 10-year-old OS. Why not bring back Windows 3.1 support as well?"
Windows 3.1 wasn't still available for you to purchase as the OS on new computers 2 years ago.
Amazing. Looking forward to buying and using the new toolset. :-)
Responding to a few questions in the comments thread…
@Paul: Including MFC?
Yes, MFC, ATL, STL, PPL, CRT, etc., will support XP targeting.
@GregM, @Jamome, others: Why "multi-targeting"? Will there be two tool chains in VS2012?
I'm using this term because folks may need to explicitly opt into XP targeting in VS, although there are still a few moving parts in this area, so it will be some weeks before we close on the design. The key point is that developers will be able to target everything from XP to Win8 with one VC++ tool chain.
@Dave Buches: What versions of XP/2k3 will be supported?
The design is not closed on this issue, either. We are aiming for a similar level of platform support to VS2010 (described at msdn.microsoft.com/…/ws0swas0.aspx). We definitely will not support an earlier SP level than VS2010, although the possibility exists that we may require a more recent SP level.
Hi Steve, if you're considering limiting to XP SP3, then please consider supporting XP SP2 also because there is only one extra function that needs to be wrapped/worked around: the GetLogicalProcessorInformation Win32 API, which was added in XP SP3 but is not available in XP SP2.
Please also consider 2003 Server (and XP) x64 edition (for native 64 bit app support)
@Steve Teixeira: Great, thanks for the response!
Oh, do you know how long after VS2012 RTM the update will be released?
@JK, we don't have a more specific release date to share yet.
Win XP forever, you will never need to reinvent the X Wheel
Sanity is restored. I may actually upgrade to VC 2012 now.
Thank you for seeing the light.
Thank you. Now we don't have to stick to VS2010 for 2-3 years!
Are the C++11 conformance updates (outside the normal release/SP cycle) still planned?
Thanks a lot for this! We all know that reverting decisions can be hard. Kudos for making the right choice.
After the update which allows targeting XP, VS11 is going to be viable for my team.
What can I say, these blog things seem to work, after all. Hoping for some progress on C++11 now, since both of the reversals are still merely taking VS11 back to where we were with VS10, but you are on the right track, keep going.
Brilliant – that'll help us a lot. Thanks.
Any hint of Brief-Emulation on the horizon?
good, now we won't be stuck in c++98 forever ;-)
Will be waiting for more technical details for the update.
Will VS2012 Express for Desktop allow compilation of 64-bit binaries?
Excellent decision. Thank you for listening to the community!
Now was that so hard? Of course it was, but whoever caused this problem in the first place is the one at fault. Fire her immediately. I forsee problems coming from this; you can't hack-back in without. It's too late now.
Will I be able to use C++11 features (ones present and what you will be adding after RTM), while targeting for XP?
Jackson: Yes – for example, the range-based for-loop.
Don't confuse marketing with engineering. Each controls one end of the product. XP as a target was always in, from the beginning. It was at the end it was 'taken out'.
I have got error on my cp one if 1711 and other how can they be fix
Great to hear! Good decision because lots of (especially) enterprise customers have still running XP machines.
So it's possible for software vendors to build upon the new libraries and compilers.
Great! For my company this was a show stopper. Now we will be able to use VS11 with new C++ features.
Woot, why are you feeding a dead horse?
Great! Enables us to move forward with C++11 despite having to support XP for some time.
Though I will propably wait with bying VS11 until someone independently confirms that the post-RTM update actually does what we expect.
The next greatest thing would be a 64 bits linker that can do PGO for 32 bits targets.
The memory requirement for the linker are exponential, particularly with PGO, so many, many big projects are hitting the 4Gb limit and have to give up on PGO.
That's great! But how exactly do you plan to achieve this? Are you going not to use modern Windows API in C Runtime?
It would be great to see a blog post about technical challenges and decisions.
Really great news! You actually listened; I am shocked! I wish the Windows 8 team would listen this well.
You seem to allude that Windows XP support is something that we would need to opt into. You also mention that you were taking advantage of a number of APIs that were Vista+.
This makes me wonder – if I target XP only, are there features of the compiler / language / runtime that will become unavailable? What trade-offs am I making by targeting XP? (Note I am wondering about this from a compiler perspective. Obviously if my app is to run on XP, my source code can't directly use new Vista+ APIs, and I'd imagine there are some newer MFC features I couldn't use. But I don't use MFC.)
Very good news for those of us who write applications that still need to support XP! We can upgrade to VS compilers supporting more C++11 features once they are available for XP.
Great news! Thanks you for listening customer feedback: this was a very misguided decision in the first place.
(only those who don't have to make decisions don't make mistakes!)
This is a huge brick in the garden of bad mouth guys saying MS is not listening customers!
Next time someone tells MS does not listen: raise this very item. Proof of Listening!
I just can't wait to put my hands on this update and upgrade my projects to VS11! :-)
I want to build C++ AMP applications. Will such an app even run on XP? Will restrict(amp) mode fall back to CPU emulation if on XP?
@kellison : To my knowledge, AMP requires SSE2, but has no hard OS dependency. I.e., as long as someone has a non-ancient CPU, I don't think AMP will have an issue on XP.
This is great news. We will be migrating our projects to the new Visual Studio 2012 when support for Windows XP is ready. Thanks for listening.
I was under the impression that AMP requires DirectX 10 which is not available on XP.
@GigaPlex,ildjarn: I would be OK with no GPU acceleration on XP as long as it fell back to CPU mode with no noticeable degradation compared to compiling without AMP. That way, it still works for XP users, but if they really want to get the performance, they need to upgrade to 7.
Nice one. If VS 2010 compiler can finally build these apps, it's simply what we want. Thanks Steve!
Комментариев нет:
Отправить комментарий