使用Visual Studio 11编译的可执行文件有什么特别之处,导致不能在Windows XP上执行可执行文件? [英] What is special about the executables compiled with Visual Studio 11 which results in that the executables cannot be executed on Windows XP?

查看:168
本文介绍了使用Visual Studio 11编译的可执行文件有什么特别之处,导致不能在Windows XP上执行可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用Visual Studio 11开发者预览编译我的C ++源代码。我静态链接到运行时库。

I compile my C++ source code with Visual Studio 11 Developer Preview. I statically link to the runtime library.

生成的可执行文件无法在Windows XP上执行。当我尝试在Windows XP上执行它时,我得到错误消息[可执行路径]不是有效的Win32应用程序。

The resulting executable cannot be executed on Windows XP. When I try to execute it on Windows XP I get the error message "[Executable Path] is not a valid Win32 Application.".

根据Microsoft Visual Studio 11不支持Windows XP。

According to Microsoft Visual Studio 11 won't support Windows XP.

它是如何工作的,生成的可执行文件不能在Windows XP上执行?

How does it work that the resulting executable cannot be executed on Windows XP? Is there anything special within the executable?

推荐答案

它们似乎在每个新版本的VS中都放弃了对旧系统的支持(NT4, 2000, XP )即使您根本不使用CRT,它们仍然会强制PE子系统版本到高数字。您可以在后期构建步骤中将数字更改回到解决该问题。只要更改这些数字应该允许exe开始在XP上,除非新的CRT使用的XPAPI不​​存在的WinAPI函数。

They seem to drop support for older systems in every new release of VS (NT4,2000,XP) Even if you don't use the CRT at all, they still force the PE subsystem version to high numbers. You can work around that by changing the numbers back to 5.0 in a post build step. Just changing those numbers should allow the exe to start on XP unless the new CRT is using WinAPI functions that don't exist on XP.

另一种替代方法,如果你想保持使用VS11是使用多目标和旧编译器...

The other alternative if you want to keep using VS11 is to use multi-targeting and older compilers...

这篇关于使用Visual Studio 11编译的可执行文件有什么特别之处,导致不能在Windows XP上执行可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆