Include file errors

Hi All,
Just started working with PlatformIO and I love it. But now, when starting a new arduino project with no code at all except for the automatically generated #include <arduino.h> , I get 2 errors:

  • #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (…workspacefoldername…)
  • Cannot open source file <arduino.h>
    Tried to add my default workspace to IncludePath like suggested on the forum, but no result.
    Any suggestions or solutions?
    Thx PPee

Does it go away after you run a build? If not, try rebuilding the IntelliSense index, because all the code sense stuff is done by the Microsoft C++ IntelliSense engine… and it probably needs a kick in the backside to get it to liven up and do it’s job.

image

2 Likes

Did the rebuild thing pfeerick, but errors persist


Result of rebuild = success, but errors persist

Do you have conflicting plugins installed for the C/C++ autocomplete? Or another Arduino plugin installed?

1 Like

Three recommended extensions installed… Conflicting?

Possibly the austin one… the recommendation was from probably from VSCode, not from PlatformIO. Try disabling that, restarting VSCode, and see what happens then.

mmmm, disabled Austin extension; errors persist

With a restart of VSCode? Try a rebuild again, and also a build to make sure all the package files are present.


Did a complete restart of the computer; restarted VSC, started a new project… same errors.

Ok… doing a new project means I don’t need to get you to try something else… so have you tried building that code yet? If you’re wondering ‘what does that have to do with these errors’… platformio downloads platform cores and libraries when you do a build… so if those files are actually not present yet (meaning the errors aren’t IntelliSense being confused, but are real)… they will get downloaded, and the errors should go away by the end of the build.

Otherwise, I’d be suggesting at you try temporarily disabling your antivirus software, and doing the rebuild intellisense again, just to rule that out (meaning if that was the cause, you’ll need to white-list stuff so it behaves itself).


Ok, so i disabled the anti virus software, did the rebuild again and entered simple wifi scanner code. Runs perfectly on a NodeMCU - no errors. But the include errors persist

Drats… Now this really is annoying. You could try deleting the .vscode folder and letting vscode rebuild it, but creating a new project rules out that sort of problem. I’m of to bed, so hopefully someone else can help out…

I will try that,
Thanks for your help and good night

I think I might have spotted whats up,

In your Enabled Extensions I do not see Arduino 0.2.26 ala this
image

[edit: possibly a red herring, I just realised when I have that enabled I get an extension conflict (that I have just been clicking ignore on)]

Yeah, the Microsoft Arduino extension causes conflicts itself, and is a known issue… there is a issue open on the VSCode github… but it’s :tumbleweed: there as far as them doing anything about it. And generally any extension that provides intellisense other than the microsoft one should be treated with caution…

The few times I’ve had issues like this, I’ve either just deleted the .piolibs folder / .vscode folder and/or triggered intellisense to be rebuilt, and one time deleted the whole $HOMEDIR/.platformio folder, and let the PlatformIO extension reinstall everything… haven’t had any problems since… even when trying to cause them with some non-standard configurations :wink:

1 Like

Interesting, I also wonder could it be some issue with being on a onedrive, :man_shrugging: , now it’s my bedtime, cio.

1 Like

Not sure… it I would think it would be fine with Dropbox since the files are stored locally on your PC - they don’t have this ‘until accessed’ feature like onedrive AFAIK… not that this shoud matter as the issue seems to stem from not being able to access core files. It could be something to do with the workspace, as it seems like there something strange with the folders that have been added? Note that it’s the double up that’s red… not the NodeMCU - RFID one (which was ealier)…

Might be worth saving that workspace for now, and opening a new empty one and adding just the Proef trial to it, to see if the error is related to something else in that workspace.

1 Like

Not sure what fixed it, but I deleted .vscode and started a new workspace, got some sleep. restarted the computer the next day, entered some new code and … it worked. I’m still puzzled. Although I really like the platformIO I’m wondering how reliable it is. Making mistakes in the code is one thing, but also having to question if may be the mistake is in PlatformIO.

1 Like