Library in in Arduino Mega2560 + VSC + PIO = No such file or directory

I have:
-Arduino Mega 2560;
-VSC 1.46.0;
-PIO- Core 4.3.4, Home 3.2.3;

In my code:

#include <Arduino.h>
#include <MultiFuncShield.h>
#include <TimerOne.h>
#include <Wire.h>

Everything is working, compiled, sended etc…

I have info in PROBLEMS window:
“Arduino.h: No such file or directory”, (original text in English)
"Can not open “MultiFuncShield.h”, (Translated by me)
"Can not open “TimerOne.h”, (Translated by me)

Why everything is working despite reported problems?
How to eliminate problems?

Thx, Mario

Can you post your platform.ini file’s content?


platform = atmelavr
board = megaatmega2560
framework = arduino

Did the IntelliSense warning in Problems go away after the compile? If it’s the first time you’ve compiled the project, there is a good chance those files (i.e. Arduino.h) don’t exist… hence IntelliSense thinks it’s a problem, not realising PlatformIO will attempt to install any missing framework/platforms/libraries when you build the project.

If the error is still there, have a use the ‘Rebuild IntelliSense Index’ option (last entry in the project tasks panel), and see if the IntelliSense warnings goes away after another compile.

1 Like


I have deleted all external library, because I don’t trust them.
F.E. MultiFucShield works with interrupts in background, and it have influence for other part of code.
It is OK, when someone want to test or learn basics and is using only one element.

Also I am a Little bit confused, that there is a lot of similar problem with library in PlatformIO. I was thinking, it is user friendly…