Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4598404
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:23:38+00:00 2026-05-21T23:23:38+00:00

I work on a mid-sized C/C++ project to which I’ve already applied Doxygen+Graphviz. Its

  • 0

I work on a mid-sized C/C++ project to which I’ve already applied Doxygen+Graphviz. Its header graphs are useful, but they only show relationships based on #include. I’m interested in finding a (preferably linux-based) tool that analyzes file dependencies based not just on #include, but on actual symbol usage. For example, such a tool would not only show that a.cpp includes b.h, but that a.cpp uses SomeClass that’s declared in c.h included by b.h. It’d also be able to suggest header includes that could be pruned.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:23:39+00:00Added an answer on May 21, 2026 at 11:23 pm

    I’ve used Include What You Use before with pretty good results. It uses Clang to parse the C++ code and suggest forwards declarations to add and header files to remove.

    One drawback is that it makes assumptions about the layout of your code – basically the Google coding standards. So it will only look at SomeFile.h if you have a file called SomeClass.cpp. Also the suggested includes use full paths from the root of your project (so #include "src/SomeClass.h" instead of #include "SomeClass.h"). In the end I changed my code to this convention anyway as it avoids ambiguity, but it needs a heads up in case you try it.

    Usually you can just set CC=include-what-you-use and rebuild to get the results – it uses all the clang machinery to parse -I include arguments. There’s a python program that uses the result to automatically update your #include lines.

    EDIT:

    Another tool that is not as sophisticated, but is simpler to set up and can suggest #includes to remove is deheader. It works by copying your C++ file to a temporary location, removing an #include and recompiling. If the recompile works, then it’s safe to remove that header file. What it won’t do is suggest forward declarations or anything fancy, but it can cut down on needless include lines in your implementation files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I work with a mid-sized team of developers all working on one product. Developers
I work with C# at work but dislike how with webforms it spews out
I work in a mid size company as a Senior dev and work on
I work in a mid size company as a intermediate developer and work on
I need to solve the following question which i can't get to work by
In my MySQL database I have dates going back to the mid 1700s which
I am writing a data-intensive application. I have the following tests. They work, but
At work we are currently still using JUnit 3 to run our tests. We
At work we are being asked to create XML files to pass data to
I work in VBA, and want to parse a string eg <PointN xsi:type='typens:PointN' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.