1

I've got cpp file with some nested include, and I'd like list all the headers are eventually included into the file (directly or indirectly) before it undergo compilation.

I can use either clang or GCC, and I wonder if there's a flag that spans the headers inside the cpp structure before it continue to the compilation part.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Zohar81
  • 4,554
  • 5
  • 29
  • 82
  • Does this answer your question? [How To Get g++ to list paths to all #included files](https://stackoverflow.com/questions/20476377/how-to-get-g-to-list-paths-to-all-included-files) – Öö Tiib Jan 16 '22 at 23:09
  • 1
    You might be looking for [`gcc -E` option](https://gcc.gnu.org/onlinedocs/gcc-3.4.0/gcc/Preprocessor-Options.html#Preprocessor%20Options). This runs preprocessor only, and produces the source after the preprocessing and before compilation proper. – Igor Tandetnik Jan 16 '22 at 23:09

0 Answers0