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

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.

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

 

posted @ 2018-09-25 17:52  SpaceVision  阅读(266)  评论(0编辑  收藏  举报