PlatformIO Community

Problem with libraries after updating them, Folder name changed

Hi, I haven’t used VSCode in awhile so there were a lot of updates.
On Windows 10.

First it told me I needed to upgrade Python so I loaded the latest version 3.9.2
Then I updated VScode.
Then PlatformIo.

After restarting VScode I updated platforms then boards if any then libraries.

After updating libraries I started to have problems in all my workspace projects.

When I updated a library it deleted the old version. Is this new? I thought it kept it and in some libraries that didn’t have updates this time had several versions in the lib folder where they are all kept.

Anyway the biggest problem I’m having is all the library folder names changed that were updated and maybe Platforms.

Here is just one Project:
Cannot find “C:\Users\JefferyS.platformio\lib\Ethernet_ID872\src”.
Cannot find “C:\Users\JefferyS.platformio\lib\AUnit_ID2778\src”.
Cannot find “C:\Users\JefferyS.platformio\lib\Adafruit STMPE610_ID377”.
Cannot find “C:\Users\JefferyS.platformio\lib\Adafruit TouchScreen_ID5430”.
Cannot find “C:\Users\JefferyS.platformio\lib\Adafruit VEML6070 Library_ID2929”.
Cannot find “C:\Users\JefferyS.platformio\lib\ArduinoHttpClient_ID798\src”.
Cannot find “C:\Users\JefferyS.platformio\lib\ESPAsyncWiFiManager_ID1438”.
Cannot find “C:\Users\JefferyS.platformio\lib\TaskScheduler_ID721\src”.
Cannot find “C:\Users\JefferyS.platformio\lib\Ethernet_ID872\src”.
Cannot find “C:\Users\JefferyS.platformio\lib\AUnit_ID2778\src”.
Cannot find “C:\Users\JefferyS.platformio\lib\Adafruit STMPE610_ID377”.
Cannot find “C:\Users\JefferyS.platformio\lib\Adafruit TouchScreen_ID5430”.
Cannot find “C:\Users\JefferyS.platformio\lib\Adafruit VEML6070 Library_ID2929”.
Cannot find “C:\Users\JefferyS.platformio\lib\ArduinoHttpClient_ID798\src”.
Cannot find “C:\Users\JefferyS.platformio\lib\ESPAsyncWiFiManager_ID1438”.
Cannot find “C:\Users\JefferyS.platformio\lib\TaskScheduler_ID721\src”.

All the libraries that were updated, the folder name lost the _ID#### at the end.

Is this a bug, new way of doing things, why didn’t the c_cpp_properties.json update. They are all showing errors.

When searching I saw something about Python 3.9 was not compatible so loaded 3.8 but nothing was fixed.

I’m at a loss of what to do except start over and load VScode and everything else from scratch.

Thanks,

Jeffery

I don’t think PlatformIO will update the IntelliSense of non-active projects, ever. If a project has errors, you should be able to use the project environment switcher to select the project, this should automatically trigger an IntelliSense rebuild. You can also trigger it via Ctrl+Shift+P → Rebuild IntelliSense. After that, the paths should the fixed.

Thanks maxgerhardt for your help. It’s greatly appreciated.

I think my IntelliSense problems have gone away but still have lots of compile errors on common libraries that worked before.

framework-arduinoespressif32 the SD library, when I compile it gives me an error of:
class “SDClass” has no member “cardType”

Several Adafruit libraries are giving me errors too yet they used to compile just fine.

Thanks for your help.

You seem to be doing SD.cardType somwhere in your code, but per

this is a function, SD.cardType(), not a variable member. Otherwise, please post the platformio.ini of the project with the code that won’t compile.

This is code that has been compiled and ran before. It’s just recently when I upgraded VScode, Platform.Io and libraries that it has been getting errors.

platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

; Serial Monitor options
monitor_speed = 115200

; Library options
; using the latest stable version
lib_deps = 
    WiFi
    FS
    SD
    Wire
    ArduinoJson
    AsyncTCP
    ESP Async WebServer
    Adafruit ADS1X15 @ 1.1.1
    Adafruit BME280 Library
    ezTime

Code: not the whole file

#include <Arduino.h>
#include <ArduinoOTA.h>
#include <ESPmDNS.h>
#include <SPIFFSEditor.h>

// Libraries for SD Card
#include "FS.h"
#include "SD.h"
#include "SPI.h"

    // init SD card
    SD.begin(SDCS_PIN);
    if (!SD.begin(SDCS_PIN))
    {
        Serial.println("Attach SD card and restart");
        return;
    }

    uint8_t cardType = SD.cardType();
    switch (cardType)
    {
    case CARD_NONE:
    case CARD_UNKNOWN:
        Serial.println("Attach SD card and restart");
        return;
    case CARD_SD:
        Serial.println("SD card detected");
        break;
    case CARD_SDHC:
        Serial.println("SDHC card detected");
        break;
    }

Thanks,

Jeffery

The library you want to use here is SD(esp32), not SD – otherwise I think you’ll be getting some SD card library meant for AVR type chips. But you don’t need to name framework-internal libraries at all in lib_deps if they’re being seen correctly by the library dependency finder – if I just use the platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

with code

#include <Arduino.h>
#include <ArduinoOTA.h>
#include <ESPmDNS.h>
//#include <SPIFFSEditor.h>

// Libraries for SD Card
#include "FS.h"
#include "SD.h"
#include "SPI.h"

#define SDCS_PIN 1

void setup() {
    // init SD card
    SD.begin(SDCS_PIN);
    if (!SD.begin(SDCS_PIN))
    {
        Serial.println("Attach SD card and restart");
        return;
    }

    uint8_t cardType = SD.cardType();
    switch (cardType)
    {
    case CARD_NONE:
    case CARD_UNKNOWN:
        Serial.println("Attach SD card and restart");
        return;
    case CARD_SD:
        Serial.println("SD card detected");
        break;
    case CARD_SDHC:
        Serial.println("SDHC card detected");
        break;
    }
}

void loop() {}

it compiles correctly, and the dependency graph shows

Dependency Graph
|-- <FS> 1.0
|-- <SD(esp32)> 1.0.5
|   |-- <FS> 1.0
|   |-- <SPI> 1.0
|-- <SPI> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <Update> 1.0
|   |-- <WiFi> 1.0
|   |-- <ESPmDNS> 1.0
|   |   |-- <WiFi> 1.0
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0

all these libraries being found correctly, without the need of declaring them in lib_deps. Remove the .pio folder of the project to make sure you don’t have artefact libaries when doing that change.

Hello, I copied exactly what you had and I received errors. And I did delete the .pio folder.

> Executing task in folder Laser Controller: C:\Users\JefferyS\.platformio\penv\Scripts\platformio.exe run <

Processing esp32-evb (platform: espressif32; board: esp32-evb; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-evb.html
PLATFORM: Espressif 32 (3.2.0) > OLIMEX ESP32-EVB
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 3.10006.210326 (1.0.6)
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 75 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <FS> 1.0
|-- <SD(esp32)> 1.0.5
|   |-- <FS> 1.0
|   |-- <SPI> 1.0
|-- <SPI> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <Update> 1.0
|   |-- <WiFi> 1.0
|   |-- <ESPmDNS> 1.0
|   |   |-- <WiFi> 1.0
|   |-- <WiFi101> 0.16.1
|   |   |-- <SPI> 1.0
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
Building in release mode
Compiling .pio\build\esp32-evb\src\main.cpp.o
Generating partitions .pio\build\esp32-evb\partitions.bin
Compiling .pio\build\esp32-evb\lib456\FS\FS.cpp.o
Compiling .pio\build\esp32-evb\lib456\FS\vfs_api.cpp.o
Compiling .pio\build\esp32-evb\lib85b\SPI\SPI.cpp.o
Compiling .pio\build\esp32-evb\liba16\SD\SD.cpp.o
Compiling .pio\build\esp32-evb\liba16\SD\sd_diskio.cpp.o
Compiling .pio\build\esp32-evb\liba16\SD\sd_diskio_crc.c.o
Compiling .pio\build\esp32-evb\lib371\Update\HttpsOTAUpdate.cpp.o
Compiling .pio\build\esp32-evb\lib371\Update\Updater.cpp.o
Archiving .pio\build\esp32-evb\lib85b\libSPI.a
Compiling .pio\build\esp32-evb\libfbf\WiFi\ETH.cpp.o
Compiling .pio\build\esp32-evb\libfbf\WiFi\WiFi.cpp.o
Compiling .pio\build\esp32-evb\libfbf\WiFi\WiFiAP.cpp.o
Archiving .pio\build\esp32-evb\lib456\libFS.a
Compiling .pio\build\esp32-evb\libfbf\WiFi\WiFiClient.cpp.o
Compiling .pio\build\esp32-evb\libfbf\WiFi\WiFiGeneric.cpp.o
Archiving .pio\build\esp32-evb\liba16\libSD.a
Archiving .pio\build\esp32-evb\lib371\libUpdate.a
Compiling .pio\build\esp32-evb\libfbf\WiFi\WiFiMulti.cpp.o
Compiling .pio\build\esp32-evb\libfbf\WiFi\WiFiSTA.cpp.o
Compiling .pio\build\esp32-evb\libfbf\WiFi\WiFiScan.cpp.o
Compiling .pio\build\esp32-evb\libfbf\WiFi\WiFiServer.cpp.o
Compiling .pio\build\esp32-evb\libfbf\WiFi\WiFiUdp.cpp.o
Compiling .pio\build\esp32-evb\libc9c\ESPmDNS\ESPmDNS.cpp.o
Compiling .pio\build\esp32-evb\lib8cb\WiFi101\WiFi.cpp.o
Compiling .pio\build\esp32-evb\lib8cb\WiFi101\WiFiClient.cpp.o
Compiling .pio\build\esp32-evb\lib8cb\WiFi101\WiFiMDNSResponder.cpp.o
Compiling .pio\build\esp32-evb\lib8cb\WiFi101\WiFiSSLClient.cpp.o
Compiling .pio\build\esp32-evb\lib8cb\WiFi101\WiFiServer.cpp.o
Compiling .pio\build\esp32-evb\lib8cb\WiFi101\WiFiUdp.cpp.o
Archiving .pio\build\esp32-evb\libfbf\libWiFi.a
In file included from C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/time.h:10:0,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFi.cpp:28:
C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/sys/unistd.h:30:9: error: conflicting declaration of C function 'int close(int)'
 int     _EXFUN(close, (int __fildes ));
         ^
In file included from C:\Users\JefferyS\.platformio\lib\WiFi101\src\utility/WiFiSocket.h:24:0,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFi.cpp:36:
C:\Users\JefferyS\.platformio\lib\WiFi101\src/socket/include/socket.h:1839:15: note: previous declaration 'sint8 close(SOCKET)'
 NMI_API sint8 close(SOCKET sock);
               ^
Compiling .pio\build\esp32-evb\lib8cb\WiFi101\bsp\source\nm_bsp_arduino.c.o
In file included from C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/stdio.h:29:0,
                 from C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:27,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\utility/WiFiSocket.h:28,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiClient.cpp:20:
C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/sys/unistd.h:30:9: error: conflicting declaration of C function 'int close(int)'
 int     _EXFUN(close, (int __fildes ));
         ^
In file included from C:\Users\JefferyS\.platformio\lib\WiFi101\src\utility/WiFiSocket.h:24:0,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiClient.cpp:20:
C:\Users\JefferyS\.platformio\lib\WiFi101\src/socket/include/socket.h:1839:15: note: previous declaration 'sint8 close(SOCKET)'
 NMI_API sint8 close(SOCKET sock);
               ^
C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFi.cpp: In member function 'int WiFiClass::init()':
C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFi.cpp:303:46: error: invalid conversion from 'void (*)(uint8_t*, uint32_t) {aka void (*)(unsigned char*, unsigned int)}' to 'tpfAppResolveCb {aka void (*)(unsigned char*, long unsigned int)}' [-fpermissive]
  registerSocketCallback(socket_cb, resolve_cb);
                                              ^
In file included from C:\Users\JefferyS\.platformio\lib\WiFi101\src\utility/WiFiSocket.h:24:0,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFi.cpp:36:
C:\Users\JefferyS\.platformio\lib\WiFi101\src/socket/include/socket.h:1047:14: note:   initializing argument 2 of 'void registerSocketCallback(tpfAppSocketCb, tpfAppResolveCb)'
 NMI_API void registerSocketCallback(tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb);
              ^
In file included from C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/stdio.h:29:0,
                 from C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:27,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\utility/WiFiSocket.h:28,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiServer.cpp:20:
C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/sys/unistd.h:30:9: error: conflicting declaration of C function 'int close(int)'
 int     _EXFUN(close, (int __fildes ));
         ^
In file included from C:\Users\JefferyS\.platformio\lib\WiFi101\src\utility/WiFiSocket.h:24:0,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiServer.cpp:20:
C:\Users\JefferyS\.platformio\lib\WiFi101\src/socket/include/socket.h:1839:15: note: previous declaration 'sint8 close(SOCKET)'
 NMI_API sint8 close(SOCKET sock);
               ^
C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFi.cpp: At global scope:
C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFi.cpp:1133:10: error: prototype for 'uint32_t WiFiClass::getTime()' does not match any in class 'WiFiClass'
 uint32_t WiFiClass::getTime()
          ^
In file included from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFi.cpp:38:0:
C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFi101.h:157:16: error: candidate is: long unsigned int WiFiClass::getTime()
  unsigned long getTime();
                ^
In file included from C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/string.h:10:0,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiUdp.cpp:20:
C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/sys/unistd.h:30:9: error: conflicting declaration of C function 'int close(int)'
 int     _EXFUN(close, (int __fildes ));
         ^
In file included from C:\Users\JefferyS\.platformio\lib\WiFi101\src\utility/WiFiSocket.h:24:0,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiUdp.cpp:22:
C:\Users\JefferyS\.platformio\lib\WiFi101\src/socket/include/socket.h:1839:15: note: previous declaration 'sint8 close(SOCKET)'
 NMI_API sint8 close(SOCKET sock);
               ^
*** [.pio\build\esp32-evb\lib8cb\WiFi101\WiFi.cpp.o] Error 1
In file included from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiClient.h:28:0,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiSSLClient.h:23,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiSSLClient.cpp:20:
C:\Users\JefferyS\.platformio\lib\WiFi101\src\socket/include/socket.h:1839:32: error: conflicting declaration of C function 'sint8 close(SOCKET)'
 NMI_API sint8 close(SOCKET sock);
                                ^
In file included from C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/stdio.h:29:0,
                 from C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:27,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiClient.h:23,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiSSLClient.h:23,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiSSLClient.cpp:20:
C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/sys/unistd.h:30:9: note: previous declaration 'int close(int)'
 int     _EXFUN(close, (int __fildes ));
         ^
*** [.pio\build\esp32-evb\lib8cb\WiFi101\WiFiSSLClient.cpp.o] Error 1
In file included from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiClient.h:28:0,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFi101.h:35,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiMDNSResponder.h:27,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiMDNSResponder.cpp:32:
C:\Users\JefferyS\.platformio\lib\WiFi101\src\socket/include/socket.h:1839:32: error: conflicting declaration of C function 'sint8 close(SOCKET)'
 NMI_API sint8 close(SOCKET sock);
                                ^
In file included from C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/strings.h:10:0,
                 from C:\Users\JefferyS\.platformio\lib\WiFi101\src\WiFiMDNSResponder.cpp:28:
C:\Users\JefferyS\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/sys/unistd.h:30:9: note: previous declaration 'int close(int)'
 int     _EXFUN(close, (int __fildes ));
         ^
*** [.pio\build\esp32-evb\lib8cb\WiFi101\WiFiClient.cpp.o] Error 1
*** [.pio\build\esp32-evb\lib8cb\WiFi101\WiFiMDNSResponder.cpp.o] Error 1
*** [.pio\build\esp32-evb\lib8cb\WiFi101\WiFiServer.cpp.o] Error 1
*** [.pio\build\esp32-evb\lib8cb\WiFi101\WiFiUdp.cpp.o] Error 1
================================================================================ [FAILED] Took 24.82 seconds =====================

Thanks,

Jeffery

This global library that you have installed is being picked up as the “WiFi” library. Delete it.

@maxgerhardt
Thank you very much! After deleting the WiFi I started seeing other things that didn’t look like they should be there and was able to get all my projects back to compiling without errors.

A lot has changed since I last used VSCode and PlatformIo.

Thanks again for all your help. I couldn’t have figured it out myself.

Jeffery