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.

IAR error (col 1) unknown or ambiguous symbol

Hello!

I'm using IAR with the MSP-FET430UIF and in my code I declare in main two variables dP and count; dP gets the value returned by a function while count is just an incremented counter. When I try to see the values of the 2 variables in the watch window I get the error "error (col 1) unknown or ambiguous symbol". 

I tried with and without optimization but it is not working, I get always the same error.

What should I do to resolve the problem as I urgently need to see these values to check the good working of my code.

Thanks in advance.

Best regards,

Emna.

  • Emma,

    Have you seen the following thread?

    https://e2e.ti.com/support/wireless_connectivity/f/156/t/120342

    Can you make sure you do not have discard-unused-publics enabled?

    Regards,

    JH

  • Hello Jace,

    Thank you for your answer. Yes I did see that thread but it didn't help me and I have already made sure that I don't have discard-unused-publics enabled.

    Best regards,

    Emna

  • Emma,

    I am sorry you are having issues here. IAR is not the main IDE I use so I'm not too familiar with the issue. That being said, I would check the declarations of those two variables for errors. I would also separate the declarations to two separate lines if they are declared in the same. I would also be sure to initialize the variables as well. Beyond this, I would start checking with IAR to see if this is a common error for the IDE and if there are tips and tricks to avoid it. You could also try to refresh your project int he IDE by making a new one in the IDE and copying over your code.

    Hope this helps!

    Regards,
    JH
  • Hello Jace,

    Thanks again for trying to help. I actually resolved the problem by removing the variables declaration from the main function and I placed them in the beginning of the main file before any function, i.e they become global instead of local variables.

    Best regards,
    Emna.
  • In the original code, did you get a 'local variable shadows global declaration' warning?
    If so, it was telling you that you have a local variable of some name, but also a global variable of the same name exists. (which would explain the 'ambiguous' message in the debugger). By moving the two outside the main code, you joined the global and the local variables. Which removed the initial problem but now may cause a different problem (two different codes are using the same variable for two different purposes).
    Well, I've never seen this error myself, so I'm only guessing.
  • IAR error (col 1) unknown or ambiguous symbol is usually when you try to see the value of a variable that is declared as static in the module.  Go to your project options --> Linker:  then select "Module-local symbols: <Include all> options.  Now, you should be able to see the variable value like normal.

  • I have the same error.
    <include all> was already set.

    Yet the error persists.

    Only global variables and ports can be seen in the watch window. Locals can't.

    Could this be due to a limited version of IAR Workbench?

    If I can't resolve the problem, I'll have to make a variable global until I know the function works, then move it back in.

    Thanks.

**Attention** This is a public forum