본문 바로가기

프로그래밍/C-CPP

[VS] LINK : warning LNK4075: '/INCREMENTAL'이(가) '/LTCG' 사양으로 인해 무시됩니다.

반응형

https://blogs.msdn.microsoft.com/vcblog/2013/10/29/the-visual-c-linker-best-practices-developer-iteration/ 에서 발췌하여 번역함.


LINK : warning LNK4075: '/INCREMENTAL'이(가) '/LTCG' 사양으로 인해 무시됩니다.


LINK : warning LNK4075: ignoring ‘/INCREMENTAL’ due to ‘/LTCG’ specification



링크타임 코드생성 (/LTCG , `L`ink-`T`ime `C`ode `G`eneration) 옵션은 링커에게 전체 프로그램 최적화를 하게 한다.

/LTCG 로 활성화되는 최적화의 흔한 예는 모듈간의 함수 인라인화이다. 많은 기타 링커 최적화와 마찬가지로, 증분

링킹은 /LTCG 가 켜졌을 때에는 비활성화된다. 왜냐하면, 링크는 여러 인풋파일간의 참조관계를 분석해야 하기 때문

이다. 링크타임 코드생성을 끄려면, 링커와 컴파일러 명령을 조정할 필요가 있다. 즉, 링커 옵션에서는 /LTCG 가 빠져야 

하고, 컴파일 옵션에서는 /GL 이 빠져야 한다.



Link-time code generation (/LTCG) causes the linker to do whole program optimization. One common example of an optimization enabled by /LTCG is the inlining of functions across modules. As with many of the other linker optimizations, incremental linking is disabled when /LTCG is turned on because the linker must analyze references across multiple input files. Turning off link-time code generation requires changes to both the linker and the complier command lines. Specifically, /LTCG must be removed from the linker command line and /GL must be removed from the compiler command line.

728x90