Compiled a C++ program in Visual Studio Professional 2013, will not work with Windows XP SP3

16.3k Views Asked by At

I usually hate asking questions but this one has me stumped.

I am creating a small game using C++ and Allegro5 in Visual Studio Professional 2013. I have used the Visual Studio 2013 – Windows XP (v120_xp) platform toolset, and made sure the Visual C++ 2013 redistributable was installed on the target machine.

I am developing using Windows 8.1, the target machine is running Windows XP SP2.

Whenever I attempt to run the program I receive a message stating .exe is not a valid Win32 application.

Even though I am not using anything related to .NET I have made sure that was installed on the target machine as well.

I have also made sure that the program itself is a 32 bit application.

I am really not sure what to try next. I have searched for the past few hours and made sure that anything necessary was installed. I am still rather new at this so it's quite possible I overlooked something simple, but I can't for the likes of me think of what.

3

There are 3 best solutions below

0
On

Probably the problem is caused by other compiler option: /arch (enable enhanced instructions set). Try to set it to /arch:IA32 (no enhanced instructions).

0
On

I've just had the same problem now fixed. You might have forgotten to set SUBSYSTEM:

Go to project properties -> linker -> system and set as appropriate.

Details here: http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx?PageIndex=2

1
On

you have to set the Platform Toolset configuration from properties (preview)

Set its value to v120_xp and it should work on windows xp.

read the post http://supportxpdotcom.wordpress.com/2013/07/16/xp-targeting-support-in-the-visual-studio-2013-preview/

see the comments http://blogs.msdn.com/b/vcblog/archive/2013/06/26/visual-studio-2013-preview-now-available.aspx