开发者

Visual C++: linking takes ages in release mode

For an unknown reason, the linking step in my C++开发者_StackOverflow中文版 app step takes just a few seconds in debug builds but over a minute in release mode. Does anyone have any idea if it's likely to be due to my project settings, or the external libs which are being linked in? Is it a common problem?


You have incremental linking activated for debug builds and not for release builds. That is what is most probable. In the project settings you can have a look at Linker -> Command Line.

  • /INCREMENTAL *.ilk file is generated to speed-up linking
  • /INCREMENTAL:NO inactive

How to change the setting: Linker -> General -> Enable Incremental Linking


It's more likely to be a more aggressive set of cross-object optimisations being applied to the release build.


Several things to try:

  • Turn on the more verbose linker settings: this may shed some light on what's going on
  • Try linking without optimisation
  • Do you have Whole Program Optimisation turned on?
  • Download and run Process Monitor to see which files it's spending time reading. There could be some strange anomaly such as the release build using a slow network drive
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜