Vscode-arduino: warning with default includePath after initialize, cannot open source file "avr/pgmspace.h"

Created on 16 May 2019  路  8Comments  路  Source: microsoft/vscode-arduino

when I did a normal initialize in a new folder just now and made a default ino file, I immediately got this error:
cannot open source file "avr/pgmspace.h" (dependency of "C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\Arduino.h")
well, warning not error. nevertheless, to fix it I had to add this to includePath:
"C:\\\\Program Files (x86)\\\\Arduino\\\\hardware\\\\tools\\\\avr\\\\avr**"
If a default ino script with no additional libraries or anything is giving me this warning because that wasn't in includePath, should that not just be in includePath by default?
I'm on the latest version, 0.2.25.

intellisense stale

Most helpful comment

Same issue under Ubuntu 18.04

I searched for the file using find -name 'pgmspace.h' from within my Arduino installation folder and found the file there. Was required to add "/home/[your_username]/.bin/arduino-1.8.10/hardware/tools/avr/avr/**" to my c_cpp_properties.json file under includePath. Adding the full path doesn't work.

Change the /home/[your_username]/.bin/arduino-1.8.10/ part to wherever you have installed your Arduino IDE and you should be fine.

All 8 comments

same issue in linux

This issue has been automatically marked as stale and closed because it has not had recent activity. Please feel free to open a new issue if you would like further discussion. Thank you for your contributions.

Having same issue. Here is error message:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\basix\Documents\Arduino\testservo\testservo.ino).

Same issue under Ubuntu 18.04

I searched for the file using find -name 'pgmspace.h' from within my Arduino installation folder and found the file there. Was required to add "/home/[your_username]/.bin/arduino-1.8.10/hardware/tools/avr/avr/**" to my c_cpp_properties.json file under includePath. Adding the full path doesn't work.

Change the /home/[your_username]/.bin/arduino-1.8.10/ part to wherever you have installed your Arduino IDE and you should be fine.

thank you schupat,
for me it worked with "..hardware/tools/avr/**" and not "...hardware/tools/avr/avr/**"

thank you schupat,
for me it worked with "..hardware/tools/avr/**" and not "...hardware/tools/avr/avr/**"

could you quote the absolute path, it's still throwing up errors

I get the same thing in windows? I added to settings.json file which has this in it
"arduino.defaultBaudRate": 9600, "arduino.logLevel": "verbose", "arduino.path": "C:\\Program Files (x86)\\Arduino", "C_Cpp.default.includePath": ["C:\\Program Files (x86)\\Arduino", "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\\avr\\include\\avr\\", "C:\\Program Files (x86)\\Arduino\\hardware\tools\\avr\\avr\\include" ],
I added the C_cpp.default stuff but still get the squiggly lines...

I solve it adding the follow line in the file: c_cpp_properties.json
"includePath":[
"C:\Program Files (x86)\Arduino\hardware\tools\**"
]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

momiccioli picture momiccioli  路  4Comments

AndreyKrupskii picture AndreyKrupskii  路  6Comments

ghent360 picture ghent360  路  3Comments

Hans007a picture Hans007a  路  4Comments

dude-dou picture dude-dou  路  6Comments