Error with include path in c_cpp_properties.json

spiffs_no_ota
Posts: 3
Joined: Wed Apr 13, 2022 5:57 am

Error with include path in c_cpp_properties.json

Postby spiffs_no_ota » Mon Oct 16, 2023 3:14 am

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 24092 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?

ESP_radurentea
Posts: 18
Joined: Thu Mar 09, 2023 8:30 am

Re: Error with include path in c_cpp_properties.json

Postby ESP_radurentea » 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?

spiffs_no_ota
Posts: 3
Joined: Wed Apr 13, 2022 5:57 am

Re: Error with include path in c_cpp_properties.json

Postby spiffs_no_ota » Tue Nov 14, 2023 3:46 am

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.

Who is online

Users browsing this forum: No registered users and 34 guests