如何递归列出源文件或头文件包含的所有 C++ 头文件
使用 C 预处理器列出包含:
gcc_includes_cmd.sh
gcc -E -M myfile.c输出如下:
gcc_includes_output.txt
myfile.o: myfile.c header1.h /usr/include/stdio.h /usr/include/stdlib.h对于递归列出,使用 -M 或 -MM 选项。你也可以编写小脚本将输出解析为列表。
Check out similar posts by category:
C/C++
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow