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.

CCS: #20 identifier "div_t" is undefined

Tool/software: Code Composer Studio

Hello

I am trying to compile my code but I get errors continuosly.

Error codes are below.

===============================================

line73 : typedef struct { int quot, rem; } div_t;

line173:    _CODE_ACCESS div_t  div(int _numer, int _denom);

===============================================

Error msgs

=============================================================================================================================================

#20 identifier "div_t" is undefined .ccsproject /Core_- line 173, external location: C:\ti\ccsv6\tools\compiler\ti-cgt-c6000_8.1.0\include\stdlib.h C/C++ Problem

#66 expected a ";" .ccsproject /Core_- line 73, external location: C:\ti\ccsv6\tools\compiler\ti-cgt-c6000_8.1.0\include\stdlib.h C/C++ Problem

=============================================================================================================================================

I am using CCS with C6000 compiler.

My div_t is already defined in stdlib.h.

I don't why CCS can't find div_t definition. I have not changed anything of stdlib.h.

I have searched about this problem but I can solve this by using reply. How can I solve this problem?

  • I cannot say what has gone wrong.  But there is a build option which can help you figure it out.

    Build with the option --gen_acp_raw.  This creates a compiler listing file.  It has the same name as the source file, with the extension changed to .rl.  You can see source lines before and after preprocessing has occurred.  You can also track when include files are entered and exited.  Please see the details of these features in the C6000 compiler manual.

    Thanks and regards,

    -George

  • Hello George .
    I'm sorry there are some missing words in my article.
    Suddenly my code looks working correctly. I don't know why :(
    Maybe rebooting OS makes it worked ...
    Anyway option (--gen ----) for debugging will be helpful soon.
    Thanks & BR
    GunUk Lee.