list of all header files included by a C file

后端 未结 3 1211
傲寒
傲寒 2020-12-20 15:13

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 li

3条回答
  •  不思量自难忘°
    2020-12-20 15:26

    Most compilers have switch to make them just preprocess the file. What means among other that they expand all #include's into an actual code. And usually they do include a comment (proper C comment) on the line of original include. So you can then search the resulting preprocessed code for all such comments to collect all included headers.

提交回复
热议问题