In the past, I used pre-compiled headers in VC to speed up compilation time, but usually only in small projects, which basically represent a small directory of source code. Since VC ++ requires that all files contain the same header exactly regardless of the path (say, "foo.h", not "../foo.h"), everything gets hairy when you have different subdirectories source. If all my files are just
#include "foo.h"
it works, but only when I have precompiled headers. To make this work in all cases, I need to make dummy foo.h files that go
#include "../foo.h"
It starts to get ridiculous pretty quickly, especially when you have several levels.
Although I usually prefer Microsoft tools, I have to say that the GCC system in which you manually compile the headers into .gch files is far superior to me. This is much less intrusive and does not require you to include all your headers in every compilation unit, which is ugly and slow if you build the compiler without pre-compiled headers.
Am I missing something in the VC version? None of the large projects that I worked on professionally used precompiled headers, and I want to make sure that I give them a decent shake before I give up and simply agree to a longer compilation time.
Is there a cleaner way to do this?
Thanks!
source share