What are the basic rules for setting the right includes for a file?
Suppose I have a class ChromaticGadget that extends Gadget and uses OS
facilities. So I have chromaticGadget.hpp and chromaticGadget.cpp. What should
go in includeDB? In particular when do you have an entry for a .hpp vs.
.cpp file, i.e. should I have:
chromaticGadget.cpp chromaticGadget.hpp chromaticGadget.cpp gadget.hpp chromaticGadget.cpp os.hpp
or:
chromaticGadget.cpp chromaticGadget.hpp chromaticGadget.hpp gadget.hpp chromaticGadget.hpp os.hpp
Answer:
To reduce compile times, the fewer .hpp files on the left hand side,
the better. So the first example is preferred except ... since you
inherit from Gadget (which presumably is declared in gadget.hpp),
I expect you'll have to change the second line in that stanza to
chromaticGadget.hpp gadget.hpp