Sco*_*ham 34 linker visual-studio visual-studio-2013
Some projects in my solution produce this linker warning:
MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
Run Code Online (Sandbox Code Playgroud)
I'm using Visual Studio 2013 Update 3. I haven't yet been able to identify anything particular to those projects that could cause this.
What is it about those projects that produces this?
I've looked at this: http://msdn.microsoft.com/en-us/library/k669k83h.aspx but I'm not aware we are using any CLR, managed code, /LN or /NOASSEMBLY.
Ion*_*POP 35
我有同样的问题,所以我做了一些研究.
根据https://msdn.microsoft.com/en-us/library/0zza0de8.aspx:
如果使用/ GL和/ c编译程序,则应使用/ LTCG链接器选项来创建输出文件.
所以消息可能有点误导 - 问题不是MSIL .netmodule,而是编译的模块/GL
在使用时/GL,您告诉编译器延迟生成一些代码,即围绕函数bounderies,以便优化它们.LTCG指示链接器生成(并优化)丢失的代码.否则,程序将无法按预期运行.
基本上,两个开关应该一起使用(使用时).它们适用于构建的不同部分:一个用于编译,另一个用于链接.
为了完整性:
/GL由配置属性> C/C++>优化>整个程序优化控制
/LTCG 由配置属性>链接器>优化>整个程序优化控制
在以后的版本中,
/LTCG 通过配置属性>链接器>优化>链接时间代码生成/使用链接时间代码生成(/ LTCG)进行控制Bor*_*nko 13
我遇到了同样的错误,花了很多时间来修复它.最后,我发现它是由于在我的一个依赖库中使用"整个程序优化"选项而出现的.
默认情况下,在新创建的项目中,此选项设置为"是".当我将其更改为"否"并重新编译所有依赖项时,警告消失了.我有纯粹的原生C++解决方案,没有任何托管代码.
要修复,请打开所有依赖项目的项目设置并检查设置:
配置属性> C/C++>优化>整个程序优化
确保它到处都设置为"否".
| 归档时间: |
|
| 查看次数: |
18128 次 |
| 最近记录: |