aoshi0603 发表于 2011-8-4 13:42

使用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是志明过了

delin17 发表于 2011-8-6 12:31

应该是没定议,或者C文没包含进工程

delin17 发表于 2011-8-6 12:32

贴下代码,说不定你可能只是声明了一下

aoshi0603 发表于 2011-8-10 09:26

找到原因了,是宏定义配置为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]
查看完整版本: 使用FatFS总是提示应用函数没有定义