Page 1 of 1

Include error in esp_vfs_fat.h

Posted: Wed Aug 30, 2023 2:15 am
by SASAKIKEI
Hi, I am new to programming and I get an error when I try to include esp_vfs_fat.h in ESP-IDF v5.1.1. esp_vfs_fat.h exists in C:\Espressif\esp-idf\components\fatfs\vfs I have a problem. How can I resolve this? The target device is esp32-s3.
Here is the error code
C:/ESP32_projects/ecorun_main_2023/main/settings.cpp:7:10: fatal error: esp_vfs_fat.h: No such file or directory
7 | #include "esp_vfs_fat.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
I am using a translator, so I apologize if my English is not correct.
Thank you for your support.

Re: Include error in esp_vfs_fat.h

Posted: Thu Aug 31, 2023 3:18 pm
by mattiavdm
Try editing the CMakeLists.txt of the component/main application to require fatfs, something like this:

Code: Select all

idf_component_register(SRCS "src/fatFS.c"
                    INCLUDE_DIRS "src" "include"
                    REQUIRES "fatfs"
                    )

replace SRCS with your source code and INCLUDE DIRS accordingly.

Re: Include error in esp_vfs_fat.h

Posted: Fri Sep 01, 2023 3:29 pm
by SASAKIKEI
It works. Thank you very much.