如何解決 ESPAsyncWebServer 錯誤 - undefined reference to `mbedtls_md5_starts' (Solving ESPAsyncWebServer - undefined reference to `mbedtls_md5_starts issues )
最近在使用 ESPAsyncWebServer 時, 發生了一個編譯的錯誤: c:/users/stone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: d:\stone\Documents\build\libraries\ESPAsyncWebServer-master\WebAuthentication.cpp.o:(.literal._ZL6getMD5PhtPc+0x4): undefined reference to `mbedtls_md5_starts' 看來是 ESPAsyncWebServer 的問題, 於是我到 Git Hub 找到了 ESPAsyncWebServer https://github.com/me-no-dev/ESPAsyncWebServer 從新下載, 更新了 Library 還是沒有辦法, 錯誤依然存在, 無法解決. 經過了3個小時反覆搜尋, 發現這是 ESPAsyncWebServer 的一個 issue, 目前還沒有被修正. 不過, 在底下有高手提出了解決方法: 找到 WebAuthentication.cpp 然在大約 72 行左右, modify in the library directory your_directory/Arduino/libraries/ESPAsyncWebServer-master/src/WebAuthentication.cpp @line 72 with this (the comment are the old line ......) 只要把原來的後3行紅色註解掉(//), 加上4個藍色新程式碼, 即可以修正! #ifdef ESP32 mbedtls_md5_init(&_ctx); mbedtls_md5_update_ret (&_ctx,data,len); mbedtls_md5_finish_ret(&_ctx,data); mbe