LX51: ERROR/WARNING ON SYMBOL DEFINITION
Information in this article applies to:
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?
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.
static unsigned char Excinfo; // now the symbol is not PUBLIC
Last Reviewed: Monday, January 8, 2007
of your data.