新手入门
- 积分
- 6
- 金钱
- 6
- 注册时间
- 2021-7-8
- 在线时间
- 1 小时
|
1金钱
#if 1
#pragma import(__use_no_semihosting)
struct __FILE
{
int handle;
};
FILE __stdout;
void _sys_exit(int x)
{
x = x;
}
int fputc(int ch, FILE *f)
{
while((USART1->SR&0X40)==0);
USART1->DR = (u8) ch;
return ch;
}
#endif
../SYSTEM/usart/usart.c(40): error: redefinition of '__FILE' 这个错误一直过不去,尝试了用下面这个方法去改头文件
#ifndef _TEST_H_
#define _TEST_H_
。。。
#endif
结果又出现这个错误:
../SYSTEM/usart/usart.c(54): error: unknown type name 'FILE'
我再次搜索百度,让我加头文件stdio.h,我加了这个头文件,又出现:../SYSTEM/usart/usart.c(40): error: redefinition of '__FILE' 错误
死循环了
|
|