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.

error #171 and error#19: Please advice

Hi,


I am getting "error #171: expected a declaration" error, for almost all the "for loops" in my C-code. However my C-code compiles fine in Codeblocks and gives me the expected results.

Below is a sample "For Loop" code that gives me error#171:

int counter1= 1;
for (hi=0;hi<12;hi++)
{

    h[hi][0] = 0;
    h[hi][1] = counter1;
    counter1 = counter1+1;
    //printf("\n h[%d][0] = %d and h[%d][1] = %d",hi,h[hi][0],hi,h[hi][1]);
}

Also please let me know, how can I declare an array of complex numbers in CCS. I am getting error#19 for the below declaration.

double complex rxd_rs0[SIZE] = {-0.4093 + 0.1022i,0.4624 + 1.6437i,-0.6945 + 1.5337i,1.4589 + 0.9446i};

Error: error #19: extra text after expected end of number


Thank you very much for your time and advice!

 

  • Based on what you show, I can only guess about the root cause of your problems.  Please add the option --verbose_diagnostics and build again.  That usually makes things much more clear.

    Thanks and regards,

    -George

  • Ashley said:
    Also please let me know, how can I declare an array of complex numbers in CCS.

    Imaginary constants are a GCC extension that the TI compiler does not support. Write it like this:

    double complex rxd_rs0[SIZE] = {-0.4093 + 0.1022 * I, 0.4624 + 1.6437 * I, -0.6945 + 1.5337 * I,1.4589 + 0.9446 * I};
  • Hi Archaeologist,


    Thank you for your reply. That helped me to fix "error#19" errors.

    Thank you very much!

  • Hi George,


    Thank you for your reply. I added the --verbose diagnostics option and built my project again. I still don't see any detailed description of the errors I am getting.

    Please find the attached  document that shows how I enabled "--verbose diagnostics" and errors in my ccs project.

    Please let me know if I need to change any other settings to view a full description of the errors.


    Thanks for your help.

    TI_E2E.docx
  • I strongly suspect that the error at line 575 is a false error, caused by the parser getting confused by the error at line 571.  In general, you should fix the first error listed in the build console before trying to fix the rest of them, particularly for "expected" errors.

    Make sure that you do not have a macro or variable named "ip" in that source file.  We may need to see the lines just before the for statement at line 575 to diagnose the problem.

  • Hi Archaeologist,


    Thanks for the advice. I just had to move all my double complex variable and array declarations to the beginning of the main program and this helped me to get rid of the errors. I am able to get some of the expected results.

    But I am running in to new issues now:

    Note: If possible, please feel free to move my post to the related forum if this is not the correct place to discuss.

    1. I need to print out the values of an array of [84][36] and selected core0 to view my results. The output stopped at [75][16] and threw gti_sim_server.exe error and then the CCS crashes. (I am using CCSv5.2.1.00018 and C6678 functional simulator). Would appreciate your guidance in this regard.

    Thank you for your time and help.

  • That does not sound familiar, and I'm not sure what forum to move you to.  I'll ask locally for some help with that.