When a project grows it becomes hard to get an overview of header inclusion. I've noticed our object files have grown rather large and so I'm thinking there's a lot to be won by rearranging dependencies. This is where the problem begin, I know of no convenient way to actually get an overview on what headers actually get included for a specific source file. There's the possibility of outputting the pre-processed source files, that however creates huge files with loads of irrelevant information. I'm thinking there must be a tool for this, but I can't seem to find any. I'm on windows, so in case anyone know of a good tool / way to actually do this for windows I'd be eternally grateful.
+4
A:
Visual C++ has the /showIncludes switch, which causes the compiler to output a message when an include is encountered.
Georg Fritzsche
2010-05-10 17:54:44
A:
This isn't a tool, but lays out some basic principles for good design of header file #includes:
http://www.eventhelix.com/realtimemantra/headerfileincludepatterns.htm
Jan Hettich
2010-05-10 19:07:51
A:
doxygen makes nice #include file dependency graphs too, if you want to see how all your headers fit together.
bde
2010-05-10 19:09:58