Page 1 of 1

Error with include path in c_cpp_properties.json

Posted: Mon Oct 16, 2023 3:14 am
by spiffs_no_ota
I'm trying to learn ESP32 using ESP-IDF and VSCode.
After installing ESP-IDF extension, I installed ESP-IDF 5.1.1. No errors happened.
Then I created new project using template, and after project was created there is a lot of strange problem and errors happen, so I check C/CPP extension settings. That's when I see most of the include paths (which is created inside c_cpp_properties.json automatically by ESP-IDF) were invalid.
Screenshot (45).png
Screenshot (45).png (272.48 KiB) Viewed 24016 times
The paths were strange because it included my workspace location in the path.
Is this ESP-IDF issue or C/CPP extension issue? What can I do to fix this?

Re: Error with include path in c_cpp_properties.json

Posted: Mon Oct 16, 2023 2:14 pm
by ESP_radurentea
I'm not really sure why might cause this. Can you run "Doctor Command" from Command Palette and paste here the output you get?

Re: Error with include path in c_cpp_properties.json

Posted: Tue Nov 14, 2023 3:46 am
by spiffs_no_ota
ESP_radurentea wrote:
Mon Oct 16, 2023 2:14 pm
I'm not really sure why might cause this. Can you run "Doctor Command" from Command Palette and paste here the output you get?
Thank you for your response. I fix this by build the project first, so cpp plugin will add ${workspaceFolder}/build/compile_commands.json" to the cpp settings. It fixs a lot of cpp Intellisense problems.
Also I add Idf.toolspathWins to my global settings, and change Idf.toolspath to Idf.toolspathWins in cpp property file.
It seems env variable Idf.toolspath doesn't play nice with Windows, at least we can change that easily.