Tool to Track #Include Dependencies

Tool to track #include dependencies

If you have access to GCC/G++, then the -M option will output the dependency list. It doesn't do any of the extra stuff that the other tools do, but since it is coming from the compiler, there is no chance that it will pick up files from the "wrong" place.

Tool to find all header and source file dependencies in C

Klocwork has an On-the-Fly source code analysis product which can figure out redundant and unused header file. Have a look to see if it fulfills your requirements.

Detecting superfluous #includes in C/C++?

It's not automatic, but doxygen will produce dependency diagrams for #included files. You will have to go through them visually, but they can be very useful for getting a picture of what is using what.

How can I see the C/C++ #include graph easily?

Doxygen, with the aid of Graphviz, can do that. You first need to edit a configuration file. This won't be easy the first time you do it, but no much editing is needed afterwards.

Is there tool for .Net/C# to capture *run-time* dependencies between classes?

CLRProfiler can capture/display CallGraph: http://www.scribd.com/doc/3376247/CLRProfiler.

The file format is documented, so you can add your own analisys.

Displaying the #include hierarchy for a C++ file in Visual Studio

There is a setting:

Project Settings -> Configuration Properties -> C/C++ -> Advanced -> Show Includes

that will generate the tree. It maps to the compiler switch /showIncludes



Related Topics



Leave a reply



Submit