Include browser of Eclipse

Include graph of term.c in the Vim source code
Include graph of term.c in the Vim source code

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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s