I'm wondering if there is an existing tool that lists the external dependencies for a set of C++ source files (e.g. one directory in a project with many directories). Something similar in concept to finding the external symbols of a binary, but it would across a set of source files.
A sample use case would be for working with an entire code base for purposes of understanding dependencies within it. For example, the developer could ask the question what other parts of the code base does the code in src/module1
depend on?
For example, if this tool was run on the following car.cc
file it would list Vehicle
and std::cout
. If it were run on both source files together it would just list std::cout
(since Vehicle is now defined within the source file set).
// vehicle.h
class Vehicle {
};
// car.cc
#include "vehicle.h"
class Car: public Vehicle {
public:
void honk() {
cout << "Honk! \n" ;
}
};
Optimally the tool would be available on Linux and support filtering out some references (like std::*).