| |||||
Technical Support Support Resources
Product Information | LX51: ERROR/WARNING ON SYMBOL DEFINITIONInformation in this article applies to:
QUESTIONI 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? ANSWERThe 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 08, 2007 | ||||
| |||||