Hello. I have problems with opening esp-idf component files. Sometimes I want to have a look at the header files of the component and see whats going on, I have followed this guide:
https://www.youtube.com/watch?v=aQi8qiW ... lijaBobija
After this guide, the "stdio.h" library became fixed, but other esp-idf components are still broken.
I have created a simple hello world example and pasted the c_cpp_properties.json file in .vscode folder.
See the image below:
https://ibb.co/yfmGr2W
for exaple I want to open freertos/task.h and see whats going on there, but it wont let me.
The code compiles and runs fine, is just that I cannot open these files from the vscode. Usually I right click on the include and I can choose "go to declaration" or "go to definition"
vscode esp-idf cannot open source file
Re: vscode esp-idf cannot open source file
This is probably because VSCode does not know where to find the header files for the esp-idf components.
You can fix this by editing your IntelliSense Configuration.
There is a section in the settings called "Include Path"
You should add the esp-idf components folder to it:
${workspaceFolder}/**
C:\Code\esp-idf\components\**
You can fix this by editing your IntelliSense Configuration.
There is a section in the settings called "Include Path"
You should add the esp-idf components folder to it:
${workspaceFolder}/**
C:\Code\esp-idf\components\**
Re: vscode esp-idf cannot open source file
Thanks for the response. I have created a brand new project just so everything is clear and simple. I have picked up wifi station example from esp-idf.
All I have done is created .vscode folder and inside this .vscode folder created c_cpp_properties.json with the following config:
I believe this is the intellisense configuration as you have mentioned.
The results are very strange , check the image:
https://ibb.co/3dgg693
Some components such as freertos/task.h and freertos/event_groups.h and eso_event.h are found and linked properly. The others have problems.
For example when I hover over #include "esp_wifi.h" it says "cannot open source file "stdint.h (dependancy of "esp_wifi.h")
All I have done is created .vscode folder and inside this .vscode folder created c_cpp_properties.json with the following config:
Code: Select all
{
"configurations": [
{
"name": "Linux",
"cStandard": "c11",
"cppStandard": "c++17",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components"
],
"limitSymbolsToIncludedHeaders": false
},
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
The results are very strange , check the image:
https://ibb.co/3dgg693
Some components such as freertos/task.h and freertos/event_groups.h and eso_event.h are found and linked properly. The others have problems.
For example when I hover over #include "esp_wifi.h" it says "cannot open source file "stdint.h (dependancy of "esp_wifi.h")
Re: vscode esp-idf cannot open source file
I may have found what was causing me temporary issues. Under my main/CMakeLists.txt I had a REQUIRES option to include my custom library. When I delete this, all components are linked and found properly.
Now there is another issue, how do I add my custom library? I have created component but it does not work
Now there is another issue, how do I add my custom library? I have created component but it does not work
Who is online
Users browsing this forum: No registered users and 231 guests