Re-build vs build
by Marcus L · in Torque 3D Professional · 07/09/2010 (7:23 am) · 4 replies
Just wondering, what is exactly the difference between doing a build instead of a rebuild in visual c++, well, except from build time. I am asking because I've come across some strange behaviors c++ side, and I'm wondering if it could be because I am building instead of rebuilding.
Thanks,
Marcus L.
Thanks,
Marcus L.
#2
07/09/2010 (9:48 am)
Well, as I said I am not sure if it was the build that caused it, I think it had more to do with a piece of code that i did wrong (and btw. i did fix it). But my main question was, is there any reason to rebuild instead of build, I mean, can it cause anything unexpected. And for some reason i have this impression that you have to rebuild when installing new classes, namespaces ect. is this ture?
#3
1. When you are adding things to a precomipled header or to something included by a PCH (i dont think torque uses PCHs at all).
2. You are working in a source control repository with lots of change (i.e. getting latest brings down hundreds of files).
3. Libraries you link against have changed.
4. You dont know the approximate state of your compiler generated files (i.e. you havent worked on your stuff in awhile)
5. You change any compile/link flags (Visual Studio will usually invalidate all compiler generated files anyway)
The only time that adding new classes or namespaces(or anything new for that matter) will have issues is if you are using precompiled headers that are not setup correctly(in my experience), but in general these changes do not require a clean or rebuild.
As I mentioned above Visual Studio is really good at handling most of these cases and adding/changing code should never be an issue. If you find yourself only able to build successfully when doing a rebuild then something is not setup correctly in your project/solution (i.e. dependencies/build order is wrong).
07/09/2010 (12:39 pm)
Here are some cases that you should be performing a rebuild instead of a build (but most are actually handled by a good compiler/linker i.e. visual studio):1. When you are adding things to a precomipled header or to something included by a PCH (i dont think torque uses PCHs at all).
2. You are working in a source control repository with lots of change (i.e. getting latest brings down hundreds of files).
3. Libraries you link against have changed.
4. You dont know the approximate state of your compiler generated files (i.e. you havent worked on your stuff in awhile)
5. You change any compile/link flags (Visual Studio will usually invalidate all compiler generated files anyway)
The only time that adding new classes or namespaces(or anything new for that matter) will have issues is if you are using precompiled headers that are not setup correctly(in my experience), but in general these changes do not require a clean or rebuild.
As I mentioned above Visual Studio is really good at handling most of these cases and adding/changing code should never be an issue. If you find yourself only able to build successfully when doing a rebuild then something is not setup correctly in your project/solution (i.e. dependencies/build order is wrong).
#4
07/09/2010 (12:51 pm)
Thanks for the info :D, I was just wondering, nothing more. I can just remember back at the first time i tried c++ to install the AIGuard, and then for some reason, i had to rebuild, but i guess that was something else.
Torque Owner Jason Eubank
Studeeoh Solo
If you are experiencing strange behavior because of a build instead of doing a rebuild then there is something very wrong, theres really no C++ code that you could write/change to cause a normal build to produce faulty binaries.
What is the strange behavior you are seeing exactly and what have you changed?