views:

224

answers:

2

I know that header guards avoid (most) trouble; call me @n@l if you like, but I just don't like a sloppy header-file tree.

If I draw on paper a box for each header file and connect them by lines representing #include, I like to see a neat hierarchy. But what I usually see is a complex web.

Maybe I am @n@l, but to me that tangled web represents sloppy-thinking and I would like to induce order by reorganizing the #include hierarchy.

Does anyone know of a tool which will let me vizualize the #include hierarchy? Preferably a free tool.

(and, yes, I know that I "could probably do it with graphviz dot", but that is not an answer ;-)

+3  A: 

Doxygen can do this for you if you use it along with the dot tool.

Here is an example: http://www.neuraladvance.com/json-c/html/json_8h.html

Simon
Doxygen can also print a neat hierarchy diagram representing all dependencies for C, C++, Python, Java, etc.
Manav MN
hmm, why didn't I think about Doxygen? Simon, can it do that for the whole project, or just on aper-file basis? I really want it for the whole project. You don't really see the complexity on a single file.
Mawg
@Mawg - I'm not sure to be honest. I've never had the need for a full dependency graph. I'm pretty sure that it would be easy to do although you might have to do a bit delving. After all Doxygen already has everything you need you might just have to do the stitching together manually.
Simon
Yep, DoxyGen does it! Thanks.
Mawg
+3  A: 

You could try cinclude2dot

Hasturkun
At first glance, it looks perfect, thanks! I'll try it out and get back to you.
Mawg
This is the kind of tool that made Unix great. +1
Norman Ramsey