Include error in esp_vfs_fat.h

SASAKIKEI
Posts: 2
Joined: Wed Aug 30, 2023 2:04 am

Include error in esp_vfs_fat.h

Postby SASAKIKEI » Wed Aug 30, 2023 2:15 am

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.

mattiavdm
Posts: 3
Joined: Thu Aug 31, 2023 2:23 pm

Re: Include error in esp_vfs_fat.h

Postby mattiavdm » Thu Aug 31, 2023 3:18 pm

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.

SASAKIKEI
Posts: 2
Joined: Wed Aug 30, 2023 2:04 am

Re: Include error in esp_vfs_fat.h

Postby SASAKIKEI » Fri Sep 01, 2023 3:29 pm

It works. Thank you very much.

Who is online

Users browsing this forum: Google [Bot] and 255 guests