Game Development Community

Rebuild Solution or Torque Demo?

by Infinitum3D · in Torque Game Engine · 06/28/2007 (8:48 am) · 3 replies

When someone says to do a rebuild, do they mean rebuild the solution or the torque demo or both? Do you have to do a clean first?

Any explanations for a newbie would be appreciated.

Thanks!

Tony
not a programmer

#1
06/28/2007 (9:50 am)
I'm not really a programmer either, but I've had to learn a few things to get by. :)

When you're working on the Torque Demo, that's the 'Project' that you're re-building. It's just one part of the overall 'solution' -- which includes all kinds of stuff -- some are vital (like Torque Demo) while some are not important to everyone (like buildWad and Maya2DTS).

Just for fun, if you open up the Torque SDK.sln file in a plain text editor, you can see some of what's going on. Also, if you look at the Torque Demo.vcproj file in Notepad, you'll see a ton of cool information about the Torque Demo project itself.

It's generally a good idea to do a clean first, but not always required. I sometimes skip that step when I've only made minor code changes and that almost never causes problems for me.

As I understand things, if you do a clean first, then re-build, *all* of the source files get re-compiled and re-linked within the project.

However, if you don't do a clean before building the current project, Visual Studio will only look for source code files that have recently been changed. Then it begins re-compiling them and any source files that need them into a new project executable (or DLL if that's what you're working on).

I'm sure I'm saying all that incorrectly, but I think that's the general idea of it. Hopefully someone here will correct me if I'm majorly wrong on the details.
#2
06/28/2007 (10:41 am)
Aaron pretty much nailed it.

If you didn't touch zLib, there's no reason to rebuild zLib. If you only touched things inside the actual SDK, then just recompile the project and not the whole solution.

With that said, I sometimes work for as long as a week without doing a clean compile. I do, as often as I can, make use of incremental compiles and if I ever run intro trouble - I'll do a clean rebuild and work from there. That rarely happens, but I've heard others say the opposite.
#3
06/28/2007 (11:33 am)
This may sound "elitist", but programmers that have been around for a very long time tend to not trust automatic dependency checking, because sometimes it fails in very undetectable ways, and leaves you in a situation where you think your code is up to date, but the compilation/linking process itself introduced subtle issues.

However, IDE's (and their underlying actors) have gotten much more sophisticated over the years, and most of the time you can trust them to do what they should--recognize what code you have changed, and re-compile automatically the files that would be affected.

Personally, I only clean a project when I've made extensive changes--things like merging in a new (major) patch, or something like bringing a branch back into main dev within a repository. I will also sometimes do a clean if I am getting testing results that just make no sense, and I am starting to suspect that it's the compilation/linking, not the actual code I'm working on that may have been the problem, but that's pretty rare.

Your milage may vary, and many people have differing opinions.