This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

diagnosis info for missing header files (TMS470 C/C++ compiler)



I am using TMS470 4.6.1. When a C header file is not found, seems that the compiler does not show the full 'include backtrace', which makes debugging hard. Example:

/tmp/test.c

#include "a.h"


/tmp/a.h

#include "b.h"


/tmp/b.h

#include "c.h"


/tmp/c.h

#include "non_exist.h"

Now I compile test.c with TMS470

TI_CGT_TMS470_4.6.1/bin/cl470 -c /tmp/test.c -I/tmp/

"/tmp/c.h", line 1: fatal error: could not open source file "non-exist.h"
1 fatal error detected in the compilation of "/tmp/test.c".
Compilation terminated.

>> Compilation failure

As you can see, cl470 does not tell me how non-exist.h is included from test.c. In real life, this makes debugging hard.

In comparison, with GCC:

cc -c /tmp/test.c -I/tmp/

In file included from /tmp/b.h:1:0,
from /tmp/a.h:1,
from /tmp/test.c:1:
/tmp/c.h:1:23: fatal error: non-exist.h: No such file or directory
compilation terminated.

My question - anyway to make cl470 to show the 'include backtrace' as GCC does? Thanks

  • The error message does tell you exactly which file (c.h) and line has the problem #include statement.  

    You can see how c.h is included by using the --preproc_includes option.  In this case, it produces a test.pp file which contains ...

    a.h
     b.h
      c.h
    More details on --preproc_includes is in the ARM compiler manual.
    Thanks and regards,
    -George