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

3

21

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.

Monstrance answered 19/11, 2013 at 1:10 Comment(9)
https://mcmap.net/q/506215/-windows-xp-and-windows-server-2003-support-in-visual-studio-2013/62576Hussey
Not that you likely haven't tried this, since it seems you were fairly thorough in your gauntlet, but is the same problem present when compiling and distributing an out-of-the-box no-depenencies Win32 app (Hello, World!) ? Just curious if this is reducible to something outside your application's purvey, and instead your toolset or distribution mechanism.Neoterism
I had tried it during my initial troubleshooting but I didn't try a "Hello World" application after I had gotten to my most recent state. So I just went and tested again using a "Hello World" and it is giving me the same error as the game. "<filepath/filename>.exe is not a valid Win32 application". In short (because I can be confusing when I type) I get the same problem with a fresh, brand new "Hello World" project.Monstrance
v110_xp had a minimum supported version XP SP3. I am confident v120_xp has the same. You will have to install XP SP3Altonaltona
Just upgraded the system to SP3. Problem persists.Monstrance
Did you use Dependency Walker ? What did it say?Monotheism
64 bit module somewhere in dependency chain is most likelyPrynne
Never heard of Dependency Walker before now so thank you for that, it will make my life easier in the future. Anyways, ran D.W. on my hello world application, no errors presented themselves, was able to locate all dependencies on the target system, and it appears as though all of the dependencies are listed as x86, which to my understanding would rule out any rogue x64 bits in there. Now I'm really puzzled.Monstrance
Can't tell if this is resolved for you or not. Maybe setting the SubSystem to Windows in your project will help. You may also need a MinimumRequiredVersion as well.Thames
P
14

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

Papke answered 19/11, 2013 at 8:3 Comment(1)
As I stated in my question, I have already done that. I have also read those threads over multiple times before posting this question.Monstrance
U
8

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

Unconnected answered 5/5, 2014 at 4:23 Comment(0)
L
1

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

Latrena answered 26/12, 2013 at 14:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.