PlatformIO Community

Won't find or open my libraries

Ok, I’m a full day into this and I can’t seem to find a way to get platformio to find my libraries, no matter how many different ways I read about and try. I started by importing an ESP32 project from Arduino IDE. All the libraries are under the ~/Documents/Arduino/libraries directory and I have done this sort of thing a hundred times without incident for uno and mega but not for esp32. But for this ESP32 (Wemos LOLIN32) project, I can’t get platformio to see or open the libraries. This must be something very simple that I am screwing up, but what? MANY THANKS IN ADVANCE.

my .platformio is as follows:

[env:lolin32]
platform = espressif32
board = lolin32
framework = arduino
lib_ldf_mode = deep
lib_extra_dirs = ~/Documents/Arduino/libraries
lib_deps = adafruit/Adafruit_MCP4725@^2.0.0

my main.cpp includes the following:

#include <Arduino.h>  // no problems...

 // THIS ONE IS IN THE ~/Documents/Arduino/libraries/GravityTDS
#include <GravityTDS.h> //for TDS card
 // ERROR: cannot open source file "GravityTDS.h"

// This one is in ~Documents\Arduino\libraries\OneWire
#include <OneWire.h> //for Dallas DS18S20 one-wire temperature sensor
// ERROR: cannot open source file "OneWire.h"

// This is a pre-installed library and works
#include <Wire.h>  //for I2C

// This one is in the project:  lib\SSD1306Wire\SSD1306.h
#include "SSD1306Wire.h" // for OLED on ESP32 
//ERROR: cannot open source file "SSD1306Wire.h"

// THIS ONE I INSTALLED USING PLATFORMIO LIBRARY TOOL.       
#include <Adafruit_MCP4725.h>  //for DAC card 
// Suddenly started finding this one after a restart of VS.

c_cpp_properties.json follows:

//
// !!! WARNING !!! AUTO-GENERATED FILE!
// PLEASE DO NOT MODIFY IT AND USE "platformio.ini":
// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
//
{
    "configurations": [
        {
            "name": "PlatformIO",
            "includePath": [
                "C:/Users/peted/OneDrive/Documents/PlatformIO/Projects/210601-162334-lolin32/include",
                "C:/Users/peted/OneDrive/Documents/PlatformIO/Projects/210601-162334-lolin32/src",
                "C:/Users/peted/OneDrive/Documents/PlatformIO/Projects/210601-162334-lolin32/.pio/libdeps/lolin32/Adafruit MCP4725",
                "C:/Users/peted/OneDrive/Documents/PlatformIO/Projects/210601-162334-lolin32/.pio/libdeps/lolin32/Adafruit BusIO",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/SPI/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_trace",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_update",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/asio",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bootloader_support",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bt",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/coap",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/console",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/driver",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/efuse",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-tls",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_adc_cal",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_event",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_client",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_server",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_https_ota",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_https_server",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_ringbuf",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_websocket_client",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/espcoredump",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ethernet",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/expat",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fatfs",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freemodbus",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/heap",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/idf_test",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/jsmn",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/json",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/libsodium",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/log",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mbedtls",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mdns",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/micro-ecc",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mqtt",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/newlib",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nghttp",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nvs_flash",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/openssl",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protobuf-c",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protocomm",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/pthread",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/sdmmc",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/smartconfig_ack",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/soc",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spi_flash",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spiffs",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcp_transport",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ulp",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/unity",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/vfs",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wear_levelling",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wifi_provisioning",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wpa_supplicant",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/xtensa-debug-module",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-face",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32-camera",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fb_gfx",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/variants/lolin32",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/ArduinoOTA/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/AsyncUDP/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/AzureIoT/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/BLE/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/BluetoothSerial/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/DNSServer/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/EEPROM/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/ESP32/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/ESPmDNS/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/FFat/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/FS/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/HTTPClient/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdate/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdateServer/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/NetBIOS/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/Preferences/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/SD/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/SPIFFS/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/SimpleBLE/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/Ticker/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/Update/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/WiFiClientSecure/src",
                "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/WiFiProv/src",
                ""
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": true,
                "path": [
                    "C:/Users/peted/OneDrive/Documents/PlatformIO/Projects/210601-162334-lolin32/include",
                    "C:/Users/peted/OneDrive/Documents/PlatformIO/Projects/210601-162334-lolin32/src",
                    "C:/Users/peted/OneDrive/Documents/PlatformIO/Projects/210601-162334-lolin32/.pio/libdeps/lolin32/Adafruit MCP4725",
                    "C:/Users/peted/OneDrive/Documents/PlatformIO/Projects/210601-162334-lolin32/.pio/libdeps/lolin32/Adafruit BusIO",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/SPI/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_trace",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_update",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/asio",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bootloader_support",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bt",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/coap",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/console",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/driver",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/efuse",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-tls",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_adc_cal",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_event",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_client",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_server",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_https_ota",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_https_server",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_ringbuf",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_websocket_client",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/espcoredump",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ethernet",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/expat",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fatfs",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freemodbus",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/heap",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/idf_test",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/jsmn",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/json",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/libsodium",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/log",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mbedtls",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mdns",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/micro-ecc",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mqtt",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/newlib",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nghttp",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nvs_flash",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/openssl",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protobuf-c",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protocomm",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/pthread",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/sdmmc",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/smartconfig_ack",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/soc",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spi_flash",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spiffs",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcp_transport",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ulp",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/unity",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/vfs",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wear_levelling",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wifi_provisioning",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wpa_supplicant",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/xtensa-debug-module",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-face",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32-camera",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fb_gfx",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/variants/lolin32",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/ArduinoOTA/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/AsyncUDP/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/AzureIoT/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/BLE/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/BluetoothSerial/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/DNSServer/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/EEPROM/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/ESP32/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/ESPmDNS/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/FFat/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/FS/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/HTTPClient/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdate/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdateServer/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/NetBIOS/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/Preferences/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/SD/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/SPIFFS/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/SimpleBLE/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/Ticker/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/Update/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/WiFiClientSecure/src",
                    "C:/Users/peted/.platformio/packages/framework-arduinoespressif32/libraries/WiFiProv/src",
                    ""
                ]
            },
            "defines": [
                "PLATFORMIO=50101",
                "ARDUINO_LOLIN32",
                "ESP32",
                "ESP_PLATFORM",
                "F_CPU=240000000L",
                "HAVE_CONFIG_H",
                "MBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"",
                "ARDUINO=10805",
                "ARDUINO_ARCH_ESP32",
                "ARDUINO_VARIANT=\"lolin32\"",
                "ARDUINO_BOARD=\"WEMOS LOLIN32\"",
                ""
            ],
            "cStandard": "c99",
            "cppStandard": "c++11",
            "compilerPath": "C:/Users/peted/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gcc.exe",
            "compilerArgs": [
                "-mlongcalls",
                ""
            ]
        }
    ],
    "version": 4
}

Does the project compile? Does Ctrl+Shift+P → Rebuild IntelliSense make a difference?

Definitely did not compile.

Rebuild did not help.

I ended up moving all libraries into the project lib directory. Worked but should not have had to do this…