工程使用C++,不能使用microlib库,在文件中添加支持函数如下[C] 纯文本查看 复制代码 int _ttywrch(int ch)
{
ch=ch;
return ch;
}
//标准库需要的支持函数
struct __FILE
{
int handle;
/* Whatever you require here. If the only file you are using is */
/* standard output using printf() for debugging, no file handling */
/* is required. */
};
/* FILE is typedef’ d in stdio.h. */
FILE __stdout;
FILE __stdin;
//定义_sys_exit()以避免使用半主机模式
void _sys_exit(int x)
{
x = x;
}
编译报错
PSDK_SIimbal_SBGC\PSDK_SIimbal_SBGC.axf: Error: L6200E: Symbol __stdout multiply defined (by stdio_streams.o and main.o).
PSDK_SIimbal_SBGC\PSDK_SIimbal_SBGC.axf: Error: L6200E: Symbol __stdin multiply defined (by stdio_streams.o and main.o).
删除FILE __stdout;FILE __stdin;后,printf不能使用。因为使用的部分库中可能使用了printf函数,所以不能删除这两个函数
这种问题怎么解决啊
|