Do we have any option in gcc to find from where a particular file header is included. I have the following scenario :
file_1.h : declare type of type_1
file_2.h :
type_1 var;
I want to check where was file_1.h included in the library that i am creating.
gcc has an option -M:
-M Instead of outputting the result of preprocessing, output a rule suitable for make describing the dependencies of the main source file. The preprocessor outputs one make rule containing the object file name for that source file, a colon, and the names of all the included files, including those coming from -include or -imacros command line options.
If you do, gcc -M filename.c
, it'll list out all headers. Same with g++.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With