The include graph of a large C++ project can be really gnarly. Sometimes, you end up with compile errors due to circular inclusion of types or headers and cannot figure out the origin of the error. Other times, you might want to know the path of header files through which a certain type is available in a source file. To view these details, I generate a header include graph using Doxygen.
However, if you are using Eclipse CDT you have something that is easier and more convenient: its Include Browser!🙂
- To open it: Go to Window -> Show View -> Include Browser. It will typically be displayed at the bottom of Eclipse.
To view the include graph of a source or header file: Go to the Project Explorer, find the file and drag its name into the Include Browser window.
By default, the include graph of the includes of the file are displayed.
You can also view which other files include the current file.
If the include graph is too cluttered, you can disable display of system includes. These are typically standard C++ header files.
You can also disable display of includes in inactive code.
Reference: Eclipse help on Include Browser
Tried with: Eclipse 4.4.2 and Ubuntu 14.04