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

自闭症网瘾萝莉.ら 提交于 2019-11-27 22:04:17

问题


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.


回答1:


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




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/20061248/compiled-a-c-program-in-visual-studio-professional-2013-will-not-work-with-wi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!