| ||||||||
Technical Support Support Resources Product Information | CARM: REPLACING LIBRARY FUNCTIONSInformation in this article applies to:
QUESTIONI have defined my own putchar function. In THUMB mode everything runs fine, but when I switch to ARM mode I receive the following linker error:
*** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: putchar?T
ADDRESS: 0000040AH
or:
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: putchar?A
Is it possible to re-define a library function? Do I need to modify the run-time library? ANSWERYou don't have to modify the compiler run-time library when you need a specially-configured version of the putchar function.
For example:
#pragma INTERWORK
#include <LPC21XX.H> /* LPC21xx definitions */
#define CR 0x0D
int putchar (int ch) { /* Write to Serial Port */
if (ch == '\n') {
while (!(U1LSR & 0x20));
U1THR = CR; /* output CR */
}
while (!(U1LSR & 0x20));
return (U1THR = ch);
}
MORE INFORMATION
SEE ALSOFORUM THREADSThe following Discussion Forum threads may provide information related to this topic.
Last Reviewed: Tuesday, August 09, 2005 | |||||||
| ||||||||