tags:

views:

423

answers:

4

I have two dll files made by around 1500 cpp files. When I need to edit one, I usually then recompile all the 1500 files from the start. But I heard there is a way to make Visual Studio recompile the modifies only, taking a lot less time... How do I do this?

+10  A: 

VS is actually pretty good in doing the dependency checks so that only necessary stuff is re-compiled. I can see a couple of (more or less likely) reasons for what you're seeing:

  • You modify a header and that's been included everywhere.
  • You're hitting "rebuild" instead of "build".
  • You have file included a cpp.
  • Something's fishy with your projects, your disk, or your date.

That's in what I consider decreasing probability order.

sbi
+2  A: 

Select the modified files, right mouse click and compile then it compiles only modified files and then build it.. it takes less time compare to simply build the whole project. Not sure about new versions of VS.net IDE.. I think VS.net IDE take cares only the modified files.. if you run "build" only not "rebuild"

Red
A: 

Hi,

I have the same problem. I am using Visual Studio 2008 Professional. Only recently, when I click the debug button, it starts to compile all files, even if they are unchanged, whereas before it only compiled the files that were unchanged. I don't think I changed any setting or even if there is a setting for this. I am not doing any of the reasons stated above:

  • You modify a header and that's been included everywhere.
  • You're hitting "rebuild" instead of "build".
  • You have file included a cpp.
  • Something's fishy with your projects, your disk, or your date.

Would anybody know if there is a setting to only compile/build unchanged files?

Many thanks in advance

Graham
A: 

Hi. Look for Precompiled Header option in Projects Properties -> C/C++ -> Precompiled Headers menu. Set it to Use instead of Create. That helped me. Below is my original message which i wanted to post here :)

Hi. I too have same problem with VS 2010. I have run build command few times so all projects are up to date. I added to one solution .cpp and .h file containing empty class. .cpp file contained only precompiled header and .h file, while .h file only #pragma once and 'class test{};'. After few builds (4 thread building) i get all up to date message. Then i changed .h file to 'class test{int a};' and after selecting build all files where rebuilt.

Also i checked for minimal recompile option and its turned on. Probably is precompiled header causing trouble. Ill check it now :D

zveljkovic