/show include equivalent option in g++

2019-01-08 00:39发布


I see that VC++ includes an option called /show include to list you the hierarchy of include files in each translation unit. This seems to be a very helpful option - to optimise/improve the compilation time in a large scale project.

Question
Is there any equivalent option in GNU g++ compiler to get these (similar output)?

2条回答
Juvenile、少年°
2楼-- · 2019-01-08 01:20

There's a variety of options for controlling this.

-MD will list files, -MMD will list non-system files as side effects of compilation

-M, -MM will generate lists instead of compiling.

-MQ, -MG, -MP and -MT generate makefile target fragments. -MF allows you to specify an output filename.

查看更多
你好瞎i
3楼-- · 2019-01-08 01:38
gcc -H

will print the names of header files as they are used.

查看更多
登录 后发表回答