Building projects

rbulph

Junior Contributor
Joined
Feb 17, 2003
Messages
397
Three questions about building projects which I haven't been able to find the answers to:

1. What's the difference between Build and Rebuild?
2. What does "Clean" do?
3. What's the reason for having a "bin" and an "obj" file within a project folder? They seem rather duplicative.

Thanks.
 
rbulph said:
1. What's the difference between Build and Rebuild?
I believe in theory Build will recompile any parts of the solution that have changed whereas Rebuild will recompile all parts of the solution. I've read that it's not perfect however and Build has been known to just recompile the entire thing.

rbulph said:
2. What does "Clean" do?
I don't appear to have this feature so I'm assuming it's a VS2005 thing. A quick search turned up this , which informs us it does the same as the command line switch /clean, but not what exactly that actually does. A further search indicated.
MSDN said:
Choose Clean Solution to delete any intermediate and output files, leaving only the project and component files, from which new instances of the intermediate and output files can then be built.

rbulph said:
3. What's the reason for having a "bin" and an "obj" file within a project folder? They seem rather duplicative.
If I'm honest I'm not entirely sure. Curiously if you have the exe in Bin open when you hit compile you get a build error, but you don't if you have the exe in Obj open. This would seem to imply that the exe in obj is not update during the standard build process.
 
PlausiblyDamp said:
IIRC the obj folder is where the intermediate files are generated during the build process, the bin folder is the resultant output.

Maybe. The obj folder contain a lot of "RESOURCES files" (whatever they are) which the bin folder doesn't. But both contain the final output, i.e. exes and dlls.
 
look at ant or nant (for .net) to see how the build process is setup manually. you will have a good idea what thinge need to be done and what the clean task is good for.

it's always good to have some background knowledge although visual studio hides most of these things pretty good.
 
Back
Top