Tarek Madkour said:
The "Compile <file>" command is intended to perform only a file
compilation (with no smarts or automatic dependency checking or
anything).
I agree that a "Build <file>" command would be a useful one. It would
perform a dependency check and build all related files as well (build
PCH, run midl, etc. if necessary). However, this would be a new
command not a replacement of "Compile <file> since I am weary of
changing the behavior of the existing command which behaved that way
since at least VC6.
Are you really weary of changing the behavior ? If so, you must have done it
many times in the past already to be so tired. I believe you might have
meant the word "wary" instead.
Simply because something has "behaved that way since at least VC6" doesn't
mean that it is the best way to behave. My suggestion, when a Compile is
being done, is simply to check if pre-compiled headers are being used, then
check if pre-compiled headers have been created, and if the answer to the
first is yes and the answer to the second is no, tell the user about it in a
nice little message box which allows the user to either stop the compile or
go ahead with it anyway. I am not interested in any other dependency check
nor in a Build file which compiles related files as well. The only change
you make to the Compile command is to do something which must benefit the
programmer. There is no downside to it since when this is not done in the
situation mentioned, ridiculous compilers errors almost always inevitably
occur. At least if you take the action I have suggested, the programmer is
alerted to the situation if he chooses to go ahead with the compile, and
therefore shouldn't be too surprised when errors do occur.
I am sorry your notion of programming in this matter seems to be that
nothing can ever be changed because it might be different than the way
Compile worked before. Try to realize that you are allowed to change things
for the better for your users, in order to make programming easier for them.
I am sure you know this, especially since the Visual Studio .NET IDE changed
many things, generally for the better IMHO, from the VC6 IDE. So it really
is allowed.
It is your product and your call to change something. I believe others have
encountered this error before and wasted time trying to figure out what it
was about, given some of the really odd compiler errors that ensue in the
situation mentioned, before realizing once again that they made the mistake
of forgetting to compile the pre-compiled header file first. Since in this
case the program ( Visual Studio IDE ) can be even smarter than the
programmer, I see nothing wrong with the IDE catching my error immediately
and telling me about it.
Thanks !
Edward Diener