Does anyone know of a tool that will analyse a C++ codebase and display a graphical representation of which files include which header files and highlight redundant includes? I've used Understand C++ but it's expensive and became very unwieldy very quickly on a large (and poorly encapsulated) codebase.
There's always the "-H" option to gcc/g++...
Eg.: % g++ -H foo.C
'-H'
Print the name of each header file used, in addition to other
normal activities. Each name is indented to show how deep in the
'#include' stack it is. Precompiled header files are also
printed, even if they are found to be invalid; an invalid
precompiled header file is printed with '...x' and a valid one
with '...!' .
Then:
As in:
% g++ -H foo.C |& awk '{print $2}' | sort | uniq -c | grep -v ' 1 '
Or is that too linux'y / unix'y for you?
(Under windows, there's always cygwin.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With