views:

240

answers:

2

I have a (native C++) visual studio solution with several projects in it, some of them being DLLs. The dependencies of the projects on each other is fed into "Project dependencies". Whenever a DLL is being changed and re-built, regardless of wether this change affects other projects or not (that is, only the implementation and not the declarations are changed), The entire dependency tree from that DLL and up is being re-linked (not recompiled, however) whenever a dependent project is being built or tested as a build candidate, while this is completely unnecessary. If I would run the dependent project from outside VS prior to the whole re-linking proccess, it would run just fine as is.

Since the project is large this whole unnecesarry process takes a significant amount of time. Any way to fix this behavior?

A: 

Well this is a typical VS behavior, when you "re-build a solution"... to overcome this "Build" the changed component rather than "Rebuilding" it and u should be fine. Or you can unload the projects/DLLs that you know they wont get changed and when rebuilding VS will only build the loaded projs and ignores the unloaded ones.

I'm not sure what you mean when you say "VS re-link and not re-compile", when you rebuild a solution, all projects are compiled and linked according to the dependency tree...

Red Serpent
+2  A: 

If I understand what you are saying then you've rebuilt a DLL and are complaining that it is relinking anything that uses that DLL?

This sounds correct to me, if you've changed a DLL then you have to relink anything that uses it as it depends on it. I'm aware that you can change the implementation inside a DLL and if you are careful to keep the interface identical then you won't have to relink it, but VC++ like most build tools only goes on change times and the time of the LIB file for it surely has changed so the only safe thing to do is relink.

If you don't want this to happen then you probably need project A to link to fixed copy of the library for the DLL and not the one from the project

John Burton