Keil Logo

LX51: ERROR/WARNING ON SYMBOL DEFINITION


Information in this article applies to:

  • C51 All Versions
  • CX51 All Versions

QUESTION

I am using a SmartMX controller that includes an SFR register with the name EXCINFO. Now I have also defined a public variable with the name Excinfo. It appears that this causes the following linker errors:

*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
    SYMBOL:  EXCINFO

*** WARNING L46: SFR SYMBOL HAS DIFFERENT VALUES
    SYMBOL:  EXCINFO

What is the reason for this errors?

ANSWER

The C51 and CX51 compiler is only case sensitive at C source level. At linker level the public symbols are not case sensitive. This is required to provide compatibility to assembler code, where all symbols are not case sensitive.

Therefore, you need to avoid defining identical symbol names that are public. You may for example define symbols using the static keyword to avoid such problems.

Example:

static unsigned char Excinfo;  // now the symbol is not PUBLIC

Last Reviewed: Monday, January 8, 2007


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.