views:

130

answers:

3

For an unknown reason, the linking step in my C++ 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?

+1  A: 

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

Adam Wright
+1  A: 

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
the_mandrill
+2  A: 

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

jdehaan