How do I build a dependency tree using C++? By dependency tree I mean, for example, checking what files a certain program needs in order to run. By checking that, I could find if there are any missing or corrupt files.
How do I do something like that?
edit:
I'm not looking for a program that does it for me!
There is no cross-platform method for calculating dependencies, because this is not actually a C++ problem. It is related to the executable format output by the compiler, and that is different on each platform.
On Linux (and probably other Unices), the ldd command is what you want. This prints out the (recursive) modules that will be required by the executable, and also tells you where they can currently be found on your system.
On Windows, Dependency Walker is an excellent graphical tool that lets you explore all of the DLLs that an executable (or another DLL) depends upon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With