vs2017: fatal error LNK1210: 已超过内部 ILK 大小限制;链接时使用 /INCREMENTAL:NO

本文解决Visual Studio 2017中遇到的LNK1210错误,该错误源于ILK文件大小限制。通过禁用增量链接,即在配置属性的链接器设置中选择/INCREMENTAL:NO,可以有效解决此问题,但可能影响调试。对于优化构建,建议关闭增量链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

vs2017碰到个怪问题:LINK : fatal error LNK1210: 已超过内部 ILK 大小限制;链接时使用 /INCREMENTAL:NO

找了一下,

https://stackoverflow.com/questions/3840509/how-can-i-avoid-exceeding-the-internal-ilk-size-limit-in-visual-studio

https://stackoverflow.com/questions/8496843/lnk1210-in-visual-studio-2008

有的说要在LINK选项中加/LTCG,先记一下,

不过我发现我用的是/INCREMENTAL,如果不需要调试信息的话,可以如下解决,

配置属性--〉链接器--〉常规--〉启动增量链接-这里选择-〉否 (/INCREMENTAL:NO)

 

如果需要调试,这就根本不算解决问题,因为生成文件大小根本性发生了改变,只能说先凑和吧

https://msdn.microsoft.com/zh-cn/library/4khtbfyf.aspx

微软的解释在这里,

https://msdn.microsoft.com/en-us/library/aa261211(v=vs.60).aspx

摘录如下

Incremental Linking

Incremental linking is enabled by default for no optimization and/or debug builds. This is equivalent to having the /incremental:yes option in the linker command line.

Incremental linking is recommended during application development and debugging, though not for the release version of your product. For optimized builds, disable incremental linking. The resulting executable (.EXE) program will run faster without incremental thunks.

In some rare and seemingly random cases, incremental linking can fail because of erroneous relocation bugs. If you have incremental linking enabled and encounter inexplicable linker errors, try turning off incremental linking.

Incremental linking can be turned on indirectly by the linker command option /debug. Incremental linking can be turned off indirectly by the linker command options /map or /pdb:none.

最后说明一下,如果不想把文件变小的话,我也没想出什么好办法。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值