Search code examples
c++includec++builderc++builder-2007

Show #include hierarchy in C++Builder


I'm having trouble with someone else's code, what seems to be header files included out of order. (E.g., I'm getting redefinition errors, some of which are even in the same file!) It would be useful to see the #include tree the C++Builder compiler is using, similar to Visual Studio's -showIncludes flag. Is there any such functionality; if so, how do I access it? I am specifically using C++Builder 2007.


Solution

  • Sadly, there are no Borland C Compiler options for displaying the hierarchy of #included files. See Embarcadero's BCC32 CLI docs.

    However, an alternative (granted, not as clean) is to use the Borland C Compiler Preprocessor, e.g.

    CPP32 -Sr source.cpp # outputs source.i with comments and indentation retained