3

I am using C/C++ Eclipse. Is there an option in the IDE or an external tool to figure out the chain as to how a header file is eventually being included?

Iceman
  • 4,202
  • 7
  • 26
  • 39

2 Answers2

2

You could just put an #error in the header file, the compiler should give you a trace like:

In file included from someheader.h:1:0,
                 from myheader.h:1,
                 from mysourcefile.c:1:
header_im_tracing.h:1:2: error: #error foobar
remram
  • 4,805
  • 1
  • 29
  • 42
1

An alternative would be to remove such header and try to build your project. Your compiler will (likely) show you the include chain.

Salsa
  • 917
  • 2
  • 13
  • 22