SDcard example issues

Hey everyone,

I copied the example from the /home/user/.platformio/platforms/espressif32/examples/espidf-storage-sdcard/src to my project.

When I try to compile this code, i get the following errors output:

lib/fatfs/src/vfs_fat.c:89:68: warning: ‘struct utimbuf’ declared inside parameter list
static int vfs_fat_utime(void* ctx, const char *path, const struct utimbuf *times);
^
lib/fatfs/src/vfs_fat.c:89:68: warning: its scope is only this definition or declaration, which is probably not what you want
lib/fatfs/src/vfs_fat.c: In function ‘esp_vfs_fat_register’:
lib/fatfs/src/vfs_fat.c:150:9: error: unknown field ‘utime_p’ specified in initializer
.utime_p = &vfs_fat_utime,
^

lib/fatfs/src/vfs_fat.c:150:20: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.utime_p = &vfs_fat_utime,
^
lib/fatfs/src/vfs_fat.c:150:20: note: (near initialization for ‘vfs.start_select’)
lib/fatfs/src/vfs_fat.c: At top level:
lib/fatfs/src/vfs_fat.c:832:68: warning: ‘struct utimbuf’ declared inside parameter list
static int vfs_fat_utime(void *ctx, const char *path, const struct utimbuf *times)
^
lib/fatfs/src/vfs_fat.c:832:12: error: conflicting types for ‘vfs_fat_utime’
static int vfs_fat_utime(void *ctx, const char *path, const struct utimbuf times)
^
lib/fatfs/src/vfs_fat.c:89:12: note: previous declaration of ‘vfs_fat_utime’ was here
static int vfs_fat_utime(void
ctx, const char *path, const struct utimbuf times);
^
lib/fatfs/src/vfs_fat.c: In function ‘vfs_fat_utime’:
lib/fatfs/src/vfs_fat.c:840:31: error: dereferencing pointer to incomplete type ‘const struct utimbuf’
localtime_r(&times->modtime, &tm_time);
^
lib/fatfs/src/vfs_fat.c: At top level:
lib/fatfs/src/vfs_fat.c:89:12: warning: ‘vfs_fat_utime’ used but never defined
static int vfs_fat_utime(void
ctx, const char *path, const struct utimbuf *times);
^
lib/fatfs/src/vfs_fat.c:832:12: warning: ‘vfs_fat_utime’ defined but not used [-Wunused-function]
static int vfs_fat_utime(void *ctx, const char *path, const struct utimbuf *times)
^
*** [.pioenvs/firebeetle32/bt/bluedroid/stack/l2cap/l2c_utils.o] Source /home/user/.platformio/packages/framework-espidf/components/bt/bluedroid/stack/l2cap/l2c_utils .c' not found, needed by target .pioenvs/firebeetle32/bt/bluedroid/stack/l2cap/l2c_utils.o’.
*** [.pioenvs/firebeetle32/lib385/fatfs/vfs_fat.o] Error 1
========================= [ERROR] Took 209.19 seconds =========================

I went to the source directory for these errors but I can’t find any errors. i have used platformio successfully for a set of other functions like wifi, sntp, http,etc. but for some reason this doesn’t work. Compiling with make from the esp-idf and flashing works perfectly…

Not sure what is causing this or what I’m doing incorrectly. Any help will really be appreicated