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.
这篇关于您知道项目文件中包含文件的工具构建树吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:您知道项目文件中包含文件的工具构建树吗?
基础教程推荐
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- CString 到 char* 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
