由C文件中包含的所有头文件列表 [英] list of all header files included by a C file

查看:236
本文介绍了由C文件中包含的所有头文件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想手臂编译C文件,它包含很多recursively..i正在试图找到这些标题的列表头文件fil​​es..is有没有更简单的方法来查找所有标题的列表文件它包括?

I am trying to "arm" compile a C file,it includes lot of header files recursively..i am trying to find the list of these header files..is there a easier way to find the list of all the header files it includes?

推荐答案

您可以使用GCCÇpreprocessor与它的选项转储递归包括标题的列表:

You can use the GCC C preprocessor with it's option to dump a list of headers recursively included:

cpp -M

这会告诉你所有的标题包括在内。

That will show you all headers included.

您可能会需要给它的根源都包括常规构建使用的目录。运行反复,增加更多的包含路径,直到错误停止。

You will probably need to give it the roots of all include directories used in your regular build. Run it iteratively, adding more include paths until the errors stop.

该命令的这种用法的完整形式是:

The full form of this command in this usage is:

cpp -M [-I include_directory *] path_to_c_file.c

这篇关于由C文件中包含的所有头文件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆