What is special about the executables compiled with Visual Studio 11 which results in that the executables cannot be executed on Windows XP?

Norbert Willhelm picture Norbert Willhelm · Oct 9, 2011 · Viewed 8.6k times · Source

I compile my C++ source code with Visual Studio 11 Developer Preview. I statically link to the runtime library.

The resulting executable cannot be executed on Windows XP. When I try to execute it on Windows XP I get the error message "[Executable Path] is not a valid Win32 Application.".

According to Microsoft Visual Studio 11 won't support Windows XP.

How does it work that the resulting executable cannot be executed on Windows XP? Is there anything special within the executable?

Answer

Anders picture Anders · Oct 9, 2011

They seem to drop support for older systems in every new release of VS (NT4,2000,XP) Even if you don't use the CRT at all, they still force the PE subsystem version to high numbers. You can work around that by changing the numbers back to 5.0 in a post build step. Just changing those numbers should allow the exe to start on XP unless the new CRT is using WinAPI functions that don't exist on XP.

The other alternative if you want to keep using VS11 is to use multi-targeting and older compilers...