使用FatFS总是提示应用函数没有定义
程序:f_putc(*data, &file);编译错误:
Error: no definition for "f_putc"
函数原型:
int f_putc (TCHAR, FIL*); /* Put a character to the file */
该函数已经在ff.c中实现,并在ff.h是志明过了 应该是没定议,或者C文没包含进工程 贴下代码,说不定你可能只是声明了一下 找到原因了,是宏定义配置为1或2就行了:
#define _USE_STRFUNC 1 /* 0:Disable or 1/2:Enable */
起初也注意到这个问题了, 所以留心函数int f_putc (TCHAR, FIL*); 的前面宏条件了:
#if !_FS_READONLY
#include <stdarg.h>
/*-----------------------------------------------------------------------*/
/* Put a character to the file */
/*-----------------------------------------------------------------------*/
int f_putc (
TCHAR c, /* A character to be output */
FIL* fil /* Pointer to the file object */
)
只是前面这个宏条和函数int f_putc()是嵌在上面宏_USE_STRFUNC里的,结果是宏条件编译里又嵌宏条件编译,当时没找到原因.
页:
[1]