#include "esp_spiffs.h" file not found

su-Koch
Posts: 11
Joined: Sat Jan 25, 2020 1:43 pm

#include "esp_spiffs.h" file not found

Postby su-Koch » Tue Dec 01, 2020 2:16 pm

Hei Guys,
on compiling my project in vscode with esp-idf extension v 4.1 I get

No such file or directory error.

But the file is there.

My CPP Config is:

{
"configurations": [
{
"name": "Win32",
"cStandard": "c11",
"cppStandard": "c++17",
"includePath": [
"${config:idf.espIdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPathWin}/components"
],
"limitSymbolsToIncludedHeaders": false
},
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}


All of the other includes I used so far are working
for example:


#include <freertos/FreeRTOS.h>
#include <freertos/task.h>

#include <esp_err.h>
#include "esp_log.h"
#include "driver/gpio.h"
#include "sdkconfig.h"

I'm 100% shure that this is another dump erro by myself missing any paths or options.

One Additional note: when I compile the spiffs project in it's component example everthing works fine.

Can anyone help me?

Manuel

RichPiano
Posts: 123
Joined: Mon May 18, 2020 2:51 pm

Re: #include "esp_spiffs.h" file not found

Postby RichPiano » Tue Dec 01, 2020 5:36 pm

The CPP file definition doesn't matter, this is just for IntelliSense. Important for the build are the CMakeLists.txt files in your workspace directories.

That being said, I have a similar problem. I will post in a seperate thread and maybe we can solve this together.

veelox
Posts: 16
Joined: Tue Nov 03, 2020 4:21 pm

Re: #include "esp_spiffs.h" file not found

Postby veelox » Tue Dec 01, 2020 6:22 pm

I previously had problem to add components until someone here made me realize the CMakeLists.txt needed to add components :
idf_component_register(SRCS "....c/h" INCLUDE_DIRS "." REQUIRES componentX) componentX being the folder inside component folder.

Now i have again this problem. I added another component the same way as my other and still gives me no such file or directory. CMakeLists.txt are weird

su-Koch
Posts: 11
Joined: Sat Jan 25, 2020 1:43 pm

Re: #include "esp_spiffs.h" file not found

Postby su-Koch » Tue Dec 01, 2020 7:50 pm

Hei Guys,
as I was able to solve this after reading your comments I wanted to line out the solution:

In the Following you can see the CMakeLists.txt of the component I'm developing:

idf_component_register(SRCS "MKSPIFFS.cpp" INCLUDE_DIRS "." REQUIRES "MKException" "spiffs")

Adding the "spiffs" after REQUIRED did solve the issue. I didn't know this is neccessary for Standard ESP-IDF components and was using this before for my Components alone (as e.g. here the MKException for a self defined Exception)

Hope this can halp you too.

Manuel

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 366 guests