Each time I build my Visual C++ solution in Visual Studio 2010, the entire project (not the entire solution) recompiles.
There must be a flag or configuration somewhere to make VS compile only the changed files + depending files. Where is it?
UPDATES:
To build, rebuild, or clean an entire solution Choose Build All to compile the files and components within the project that have changed since the most recent build. Choose Rebuild All to "clean" the solution and then builds all project files and components. Choose Clean All to delete any intermediate and output files.
For a multi-project solution, "rebuild solution" does a "clean" followed by a "build" for each project (possibly in parallel). Whereas a "clean solution" followed by a "build solution" first cleans all projects (possibly in parallel) and then builds all projects (possibly in parallel).
If in addition you get the a message similar to:
Creating ".\Release\SomeLib.unsuccessfulbuild" because "AlwaysCreate" was specified.
when building, the reason might be that one of your projects refers to a header file which does not exist on disk (see here and here).
The first link also includes a small C# script to check for this situation. To fix, simply remove the reference to the non-existing header files from your project.
Update
It might be possible that you have your precompiled-headers setting on 'Create'. To fix, right-click your project in the solution browser and select: properties -> C/C++ -> Precompiled Headers -> Precompiled Header. Change the setting from Create to Use or Not Using Precompiled Headers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With