I know this is an old question, a slightly more useful conclusion than gcc / g ++ -E itself, also used the -H flag (instead or in addition):
g++ -H {my -I and other flags} -E -o /dev/null file.cpp
Here's an example of the conclusion, the tree structure helps to find out who included what, as a bonus, he also lists at the bottom which files can benefit from the included defender
. generated/gen-cpp/File.h .. /usr/include/thrift/TProcessor.h ... /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/string .... /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/x86_64-redhat-linux/bits/c++config.h ..... /usr/include/bits/wordsize.h ..... /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/x86_64-redhat-linux/bits/os_defines.h ...... /usr/include/features.h ....... /usr/include/sys/cdefs.h ........ /usr/include/bits/wordsize.h ....... /usr/include/gnu/stubs.h ........ /usr/include/bits/wordsize.h ........ /usr/include/gnu/stubs-64.h ..... /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/x86_64-redhat-linux/bits/cpu_defines.h .... /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stringfwd.h ...
source share