Keil Logo

CARM: L104: MULTIPLE PUBLIC DECLARATION 'GETCHAR'


Information in this article applies to:

  • ARM Development Tools — Any Version

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

  • Refer to Basic I/O in the CARM User's Guide.

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Tuesday, October 18, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.