使用STVD编译器,重定义printf函数后,使用的时候报错
下面是程序
#define __GNUC__
#ifdef __GNUC__
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif
PUTCHAR_PROTOTYPE
{
/* Write a character to the USART */
// USART_SendData8(EVAL_COM1, c);
/* Loop until the end of transmission */
// while (USART_GetFlagStatus(EVAL_COM1, USART_FLAG_TC) == RESET);
UART1->DR=(ch);
/* Loop until the end of transmission */
while (!(UART1->SR & UART1_FLAG_TXE));
return (ch);
}
下面是报错内容
#error clnk Debug\spwm1.lkf:1 symbol _memchr not defined ((C:\Program Files (x86)\COSMIC\CXSTM8_32K\Lib\libfs0.sm8)dtog.o )
#error clnk Debug\spwm1.lkf:1 symbol _strlen not defined ((C:\Program Files (x86)\COSMIC\CXSTM8_32K\Lib\libfs0.sm8)cprint.o )
#error clnk Debug\spwm1.lkf:1 symbol _toupper not defined ((C:\Program Files (x86)\COSMIC\CXSTM8_32K\Lib\libfs0.sm8)cprint.o )
#error clnk Debug\spwm1.lkf:1 symbol _putchar not defined ((C:\Program Files (x86)\COSMIC\CXSTM8_32K\Lib\libfs0.sm8)cprint.o )
#error clnk Debug\spwm1.lkf:1 symbol __udiv not defined ((C:\Program Files (x86)\COSMIC\CXSTM8_32K\Lib\libfs0.sm8)dtoe.o (C:\Program Files (x86)\COSMIC\CXSTM8_32K\Lib\libfs0.sm8)cnorm.o )
#error clnk Debug\spwm1.lkf:1 symbol __itob not defined ((C:\Program Files (x86)\COSMIC\CXSTM8_32K\Lib\libfs0.sm8)cprint.o )
#error clnk Debug\spwm1.lkf:1 symbol __ltob not defined ((C:\Program Files (x86)\COSMIC\CXSTM8_32K\Lib\libfs0.sm8)cprint.o )
The command: "clnk -l"C:\Program Files (x86)\COSMIC\CXSTM8_32K\Lib" -l"C:\Program Files (x86)\COSMIC\CXSTM8_32K\Lib" -o Debug\spwm1.sm8 -mDebug\spwm1.map Debug\spwm1.lkf " has failed, the returned value is: 1
exit code=1.
求大神帮助
|