C, C++ and Intel Visual Fortran applications built using Microsoft Visual Studio 2012 or 2013 may fail to run on Windows XP or Windows Server 2003. The typical failure mode is the error "<path to executable> is not a valid Win32 application." The first cause of this error is that the Microsoft Visual C++ libraries included in the original release of Visual Studio 2012, used for building C, C++ and Intel Visual Fortran applications, make use of Windows API routines not present in those earlier versions of Windows.
This problem is partially resolved by installing Service Pack 1 of Visual Studio 2012. It provides C++ libraries that are compatible with Windows XP and also installs a Platform SDK that is compatible with Windows XP. For more information, see Windows XP Targeting with C++ in Visual Studio 2012. This does not apply to Visual Studio 2013 or later versions of Visual Studio.
There is one additional step you must take after installing Service Pack 1 (or a later Service Pack) of Visual Studio 2012, or if you use a later version of Visual Studio:
For C/C++ projects, right click on the project and select Properties. On the Configuration Properties. Change Configuration to "All Configurations". On the Configuration Properties > General page, change Platform Toolset to:
- In Visual Studio 2012: "Visual Studio 2012 - Windows XP (v110_xp)". Click OK.
- In Visual Studio 2013: "Visual Studio 2013 - Windows XP (v120_xp)". Click OK
- In Visual Studio 2015: "Visual Studio 2015 - Windows XP (v140_xp)". Click OK
For Fortran projects, right click on the project and select Properties. Select the desired Solution Platform (Win32 or x64). Go to Linker > System. If the options for Subsystem include "Console for Windows XP" and "Windows for WIndows XP" choose "Console for Windows XP if you have a Fortran Console Application project or "Windows for Windows XP" for any other application project type.
Note: If you are building for Windows XP 64-bit and are using Intel Parallel Studio XE 2015 (compiler 15.0), this will set the wrong value - use the steps in the next paragraphs instead.
If those options are not shown, change Subsystem to "Not Set". Now go to Linker > Command Line. If it is a Console application, type the bolded text into the Additional Options field:
/SUBSYSTEM:CONSOLE,"5.01" (for Win32) or /SUBSYSTEM:CONSOLE,"5.02" (for x64)
if it is any other project, type in:
/SUBSYSTEM:WINDOWS,"5.01" (for Win32) or /SUBSYSTEM:WINDOWS,"5.02" (for x64)
Repeat for the other solution platform if needed. Now rebuild the application.