PlatformIO Community

Installed Library not found when included?

I’m quite new to PlatformIO and VSCode, although have quite a bit of experience with coding. I am however stumped as to why VSCode seems to think my libraries do not exist.
My code works fine with the IDE, so its just a PlatformIO/VSCode setup issue.

I’ve setup a Wemos D1 Mini project with my ini file looking like so:

[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino

The 2 libraries that are giving me errors are FirebaseESP8266.h and SSD1306Wire.h

#include <Arduino.h>
#include "FirebaseESP8266.h"
#include <ESP8266WiFi.h>
#include <EEPROM.h>
#include <Servo.h>
#include "SSD1306Wire.h"

For Firebase, I have gone to PIO Home and installed the lib to my project. Is there anything more I need to do here, or should this just be working?

If I try to compile it, it says src\main.cpp:2:29: fatal error: FirebaseESP8266.h: No such file or directory

Check your platformio.ini, and add

lib_deps =
   Firebase ESP8266 Client
   ESP8266_SSD1306

to it if not present, assuming I got the right libraries. It seems that installing a library to a project is currently not working properly.

Ah thanks. That’s done it.

I assume that when you install a library to a project, it should automatically add to the lib_deps for you under normal circumstances?

1 Like

That’s what I would have expected to happen. To be honest, I hadn’t tried installing a library via PIO home that way before… I always just put the lib_deps entries in manually. It seems pretty pointless to have the project install option though if it a) doesn’t add to the lib_deps entry and b) doesn’t install the library to the project library cache folder.

1 Like

I’ve just filed a bug report so this can be looked into.

1 Like