Tool to track #include dependencies(跟踪#include 依赖项的工具)
问题描述
有什么好的建议吗?输入将是头文件的名称,输出应该是直接或间接包括它的所有文件的列表(最好是树).
Any good suggestions? Input will be the name of a header file and output should be a list (preferably a tree) of all files including it directly or indirectly.
推荐答案
如果你可以访问 GCC/G++,那么 -M
option 会输出依赖列表.它不会像其他工具那样做任何额外的事情,但由于它来自编译器,所以它不可能从错误"的地方拾取文件.
If you have access to GCC/G++, then the -M
option will output the dependency list. It doesn't do any of the extra stuff that the other tools do, but since it is coming from the compiler, there is no chance that it will pick up files from the "wrong" place.
这篇关于跟踪#include 依赖项的工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:跟踪#include 依赖项的工具
基础教程推荐
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- 从 std::cin 读取密码 2021-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01