Do you know tool building tree of include files in projectfile?(您知道项目文件中包含文件的工具构建树吗?)
问题描述
说,我想要一个工具(或脚本?)获取项目(或 .h 文件)并构建包含在其中的包含"的可搜索树(包含到包含到等等).有没有这样的东西?我应该自己写这个吗[当然我是:),但可能有人已经写好了,或者可能知道如何得到它]?
Say, I'd like to have a tool (or script?) taking project (or .h file) and building searchable tree of "includes" included into it (of included into of included into and so so on). Is there exist something like this? Should I write this by myself [of course I am :), but may be somebody had it already written or may be has an idea how to get it]?
推荐答案
不完全确定这是您想要的,但是您可以通过从基础 c 生成后 CPP 处理的文件轻松获得包含列表文件,并 grepping 出文件/行号注释,例如,使用 gcc
Not entirely sure this is what you're after, but you can easily get a list of includes by generating the post-CPP-processed file from the base c file, and grepping out the file/line number comments, e.g., using gcc
gcc -E main.c {usual flags} | grep '#' | cut -d' ' -f3 | sort | uniq
其中 main.c 是您的基本 c 文件.
where main.c is your base c file.
这篇关于您知道项目文件中包含文件的工具构建树吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:您知道项目文件中包含文件的工具构建树吗?


- 如何对自定义类的向量使用std::find()? 2022-11-07
- STL 中有 dereference_iterator 吗? 2022-01-01
- 从python回调到c++的选项 2022-11-16
- 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01
- 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01
- 近似搜索的工作原理 2021-01-01
- Stroustrup 的 Simple_window.h 2022-01-01
- 静态初始化顺序失败 2022-01-01
- 使用/clr 时出现 LNK2022 错误 2022-01-01
- C++ 协变模板 2021-01-01