Page 1 of 1

#include "esp_spiffs.h" file not found

Posted: Tue Dec 01, 2020 2:16 pm
by su-Koch
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

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

Posted: Tue Dec 01, 2020 5:36 pm
by RichPiano
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.

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

Posted: Tue Dec 01, 2020 6:22 pm
by veelox
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

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

Posted: Tue Dec 01, 2020 7:50 pm
by su-Koch
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