ARM Technical Support Knowledge Articles

L104: MULTIPLE PUBLIC DECLARATION 'GETCHAR'

Applies to: CARM C Compiler

Answer


Information in this article applies to:


QUESTION

After adding the scanf function to my program code, I now get the following two linker error messages:

*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
    SYMBOL:  getchar?T

*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
    SYMBOL:  getchar?A

The getchar function is defined in the module SERIAL.C (which I have taken from one of the example projects) and this module is translated using the INTERWORK directive. What causes these errors?

ANSWER

scanf uses the function _getkey as basic input routine. Rename getchar to _getkey as shown below:

int _getkey (void)  {                    /* Read character from Serial Port   */

  while (!(U1LSR & 0x01));

  return (U1RBR);
}

After this, everything should just work fine.

MORE INFORMATION

SEE ALSO

Article last edited on: 2005-10-18 11:05:48

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential