PlatformIO Community

includePath from c_cpp_properties.json resets itself on restart


#1

Hi!

I’m writing a C++ program for ATMEGA2560 using PatformIO.
Many parts of my program are inside different folders inside the “src” folder.

I get #include errors with IntelliSense. I use the lightbulb to add the includePath and the problem is gone. I can see that my entry is added to the c_cpp_properties.json

When I close and restart VS Code, the c_cpp_properties.json get my added line removed, and the #include error is back.

How can I avoid this and make sure my c_cpp_properties.json keep my added lines?


#2

This is expected behaviour. May I draw your attention to one of the first few lines of the file…

“name”: “!!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags

I expect you’ll need to use the -Idir and maybe the -Ldir flags.


#3

http://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-flags