vs2013控制台应用程序使用v120_xp工具集编译后提示“不是有效的win32应用程序”

新建的一个vs2013控制台应用程序,在使用v120_xp工具集编译后,在windows xp上运行时,仍然提示“不是有效的win32应用程序”。

 

解决:

1、右键项目->属性->链接器->系统->子系统->选择“控制台 (/SUBSYSTEM:CONSOLE)”

2、右键项目->属性->链接器->系统->所需的最低版本->5.01

 

原文引用:(https://devblogs.microsoft.com/cppblog/windows-xp-targeting-with-c-in-visual-studio-2012/

" Specify the correct subsystem and subsystem version for the linker based on the type of application you are building. Applications targeting the x86 version of Windows XP must specify subsystem version 5.01, and applications targeting x64 must specify version 5.02.

For x86 console applications: 
set LINK=/SUBSYSTEM:CONSOLE,5.01 %LINK%

For x64 console applications:
set LINK=/SUBSYSTEM:CONSOLE,5.02 %LINK%

"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值