| ARM Technical Support Knowledge Articles | |
Applies to: BL51 Code-banking Linker/Locator
Information in this article applies to:
The following C file (C:MYCODEJ1.C)...
/*------------------------------------------------------------/*
extern long Junk;
int junk;
void main (void)
{
for (junk = 0; junk < 100; junk++)
{
Junk = 1000L * junk;
}
}
/*------------------------------------------------------------/*
generates the following error when compiled and linked with the Keil 8051 tools:
*** ERROR 118: REFERENCE MADE TO ERRONEOUS EXTERNAL
SYMBOL: JUNK
MODULE: C:MYCODEJ1.OBJ (J1)
ADDRESS: 0020H
What is wrong?
Your program is technically correct. The problem lies in the object module format of the object files created by the Keil C Compiler.
The object files are created according to the OMF-51 object module format specified by Intel. This object module format does not allow lowercase variable names. Therefore, all public variables are treated as uppercase. When you create 2 public symbols with the same name but with different cases, the linker complained about ERRONEOUS EXTERNALS.
Change the name of one of the variables to avoid this problem.
Article last edited on: 2005-07-19 15:13:56
Did you find this article helpful? Yes No
How can we improve this article?