Error while compiling for file "Update.h"

Hi guys I was compiling my application in platformio but I started to have compiling issues without doing nothing…

#include "Arduino.h"
#include "stdlib_noniso.h"
#include "WiFi.h"
#include "AsyncTCP.h"
#include "Update.h"
#include "esp_int_wdt.h"
#include "esp_task_wdt.h"
#include "Hash.h"
#include "ESPAsyncWebServer.h"
#include "FS.h"
#include "elegantWebpage.h"
#include <webserver_mng.h>
 ^
lib/modbus/modbus_mng.cpp: In function 'uint16_t call_state_machine(TRegister*, uint16_t)':
lib/modbus/modbus_mng.cpp:136:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
In file included from lib/webserver/webserver_mng.cpp:44:
lib/webserver/OTA/AsyncElegantOTA.h:50:10: fatal error: Update.h: No such file or directory

If i try to comment the include with Update.h I got

Archiving .pio\build\esp32dev\libFrameworkArduino.a
Indexing .pio\build\esp32dev\libFrameworkArduino.a
Linking .pio\build\esp32dev\firmware.elf
c:/users/simone.gasparella/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib5bd\libESP Async WebServer.a(WebAuthentication.cpp.o):(.literal._ZL6getMD5PhtPc+0x8): undefined reference to `mbedtls_md5_starts'
c:/users/simone.gasparella/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib5bd\libESP Async WebServer.a(WebAuthentication.cpp.o): in function `getMD5(unsigned char*, unsigned short, char*)':
C:\Users\simone.gasparella\Projects\iot_esp_platformio/.pio/libdeps/esp32dev/ESP Async WebServer/src/WebAuthentication.cpp:73: undefined reference to `mbedtls_md5_starts'

That error is discussed in

Update espressif 32 Version >4.1.0 leads to Error: collect2.exe: error: ld returned 1 exit status - #5 by themed.

The source of the error is that PlatformIO updated the Espressif32 platform to the one using the Arduino 2.0.x core, which breaks compatibility with a bunch of libraries that the library developeres have not yet fixed. You can fixate the platform version too to get back to the old working core per post above.

Auto-updating platforms can be disabled with the CLI and pio settings get and pio settings set <setting> <new value> commands. Hm actually that’s just the core, not sure about platforms…

1 Like