C++ binary doesn't work on windows XP

一笑奈何 提交于 2019-12-02 11:37:34

问题


I have a very basic program in C++ compiled in VS 11 Beta on windows 7.

All project settings are default except Runtime Library. I changed Multi-threaded DLL (/MD) to Multi-threaded (/MT). This staticly links the runtime library as far as I know.

Trying to run this exe on another windows 7 machine with VS 11 Beta installed works fine.

Trying to run it on a windowx XP machine with no VS installed causes an error popup saying.

"**.exe is not a valid Win32 application"

Is there some settings that need to be changed to make a binary work on XP that was compiled with VS 11 Beta on Win7?


回答1:


VS 11 no longer supports Windows XP. This is by design from Microsoft.

http://connect.microsoft.com/VisualStudio/feedback/details/690617

This behavior is by design in MFC and CRT for Visual Studio 11 Beta. The minimum supported operating systems are Windows Server 2008 SP2 and Windows Vista. Windows XP is not a supported operating system for the Beta release (design-time or run-time).

Reading further into the discussion, there's a possibility that Windows XP may be supported in the release version. I wouldn't bank on it though.

Edit: Microsoft have relented: Targeting Windows XP with C++ in Visual Studio 2012




回答2:


Probably you compiled for 64 bit Windows. Windows XP, however, only supports 32 bit code.



来源:https://stackoverflow.com/questions/10095716/c-binary-doesnt-work-on-windows-xp

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