This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Undefined symbol getkey (referred from function) ; how to resolve

Hi,

I am using the following code in retarget.c

#include <stdio.h>
#include <rt_misc.h>

#pragma import(__use_no_semihosting_swi)

extern int sendchar(int ch); /* in Serial.c */
extern int getkey(void); /* in Serial.c */
extern long timeval; /* in Time.c */

struct __FILE
{ int handle;} ;
FILE __stdout;
FILE __stdin;
FILE __stderr;

int fputc(int ch, FILE *f) { return (sendchar(ch));
}

int fgetc(FILE *f) { return (sendchar(getkey()));
}

int ferror(FILE *f) { /* Your implementation of ferror */ return EOF;
}

void _ttywrch(int ch) { sendchar (ch);
}

void _sys_open(int return_code) { while (1); /* endless loop */
}

but i am getting the following errors

26564:Error: L6218E: Undefined symbol getkey (referred from Init.o).
26565:Error: L6218E: Undefined symbol sendchar (referred from Init.o).

Please let me know how to resolve the issue.

Thanks in Advance.
Ramu

Parents Reply Children
No data