ESPAsyncWebServer or AsyncTCP won't compile

  • ESP32

You may see

fatal error: AsyncTCP.h: No such file or directory
fatal error: ESPAsyncWebServer.h: No such file or directory
error: 'mbedtls_md5_starts_ret' was not declared in this scope
error: passing 'const AsyncWebServer' as 'this' argument discards qualifiers

Why it happens

  • The two libraries aren't installed.
  • An old copy from a .zip doesn't fit ESP32 core 3.x. The project moved to a new home called ESP32Async.

How to fix it

  1. Delete the old ESPAsyncWebServer and AsyncTCP folders from Documents/Arduino/libraries.
  2. In the Library Manager install ESP Async WebServer by ESP32Async and Async TCP by ESP32Async.
  3. Or keep the .zip versions and install ESP32 core 2.0.17.

It worked if: Verify passes.

From the official documentation. The missing AsyncTCP line came from compiling our lesson here; the move to ESP32Async is from the project page. The other two lines are the ones usually reported and were not reproduced. Sources: ESPAsyncWebServer (ESP32Async).

Didn't help? Search another error or ask us.