首页 > 其他分享 >制作bsp时编译工程出错Error: L6218E: Undefined symbol fsync (referred from syscalls.o)的解决办法

制作bsp时编译工程出错Error: L6218E: Undefined symbol fsync (referred from syscalls.o)的解决办法

时间:2022-08-19 09:13:55浏览次数:55  
标签:information return Undefined fsync symbol bsp syscalls Error fh

image

出现错误是:

*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\keil525\ARM\ARMCC\Bin'
Build target 'rt-thread'
compiling syscalls.c...
linking...
.\build\keil\Obj\rt-thread.axf: Error: L6218E: Undefined symbol fsync (referred from syscalls.o).
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 2 information, 0 warning and 1 error messages.
".\build\keil\Obj\rt-thread.axf" - 1 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:01

原始代码:

int _sys_ensure(FILEHANDLE fh)
{
    return fsync(fh);
}

修改成如下即可:

int _sys_ensure(FILEHANDLE fh)
{
#ifdef DFS_USING_POSIX
    return fsync(fh);
#else
    LOG_W("%s: %s", __func__, _WARNING_WITHOUT_FS);
    return 0; /* error */
#endif /* DFS_USING_POSIX */
}

标签:information,return,Undefined,fsync,symbol,bsp,syscalls,Error,fh
From: https://www.cnblogs.com/chino-ll/p/16600805.html

相关文章