Libraries installed, then not found

I install necessary libraries using the PlatformIO library tools. I can see that they are installed using the PlatformIO library tools. I can see them in the platformio.ini. But the compiler can’t find them.

Here there is an include in Sensors.h to include PetesLCD.h Both places I get the errors regarding finding both libraries SoftWire.h and AsyncDelay.h Screen captures attached.

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\peted\OneDrive\Documents\PlatformIO\Projects\210701-154821-megaatmega2560\src\Sensors.cpp).

cannot open source file “AsyncDelay.h” (dependency of “PetesLCD.h”)

Any advice is welcome…

screen 2
screen 1

Well dang… Third restart of VS and finally it finds the library. What’s with that?

First of all you need to check whether it’s a build error or not. If the project builds, it’s just an intellisense error and you need to rebuild the IntelliSense by doing a Ctrl+Shift+P → Rebuild IntellISense. Restarting VSCode and waiting for the intellisense rebuild also works, but is of course more unusual. If the project fails to compile, the libraries are not included correctly. I see you found out you problem fell in the first category.

Thanks for that reminder Max. I just have to develop a nervous twitch on the keyboard and hit Ctrl+Shift+P more often ;^)

You can also sanity-check that in the PlatformIO extension settings that “Auto Rebuild Autocomplete Index” is on (which should be the default), so the PlatformIO extension should auto-rebuild after adding a library.

If this constistently does not work, please report a bug to Issues · platformio/platformio-vscode-ide · GitHub with the exact execution flow.

Yes, that is set. Thankyou again Max.