赞
踩
在platformio.ini里面添加了ESPAsyncWebServer这个库,相关配置内容如下:
lib_deps =
ESP Async WebServer
调用这一条函数后编译出错:
server.serveStatic("/", SPIFFS, "/").setDefaultFile("index.html");
下面是错误完整内容(可能没有看的必要)
c:/users/nae/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\libb7f\libESP Async WebServer.a(WebAuthentication.cpp.o):(.literal._ZL6getMD5PhtPc+0x4): undefined reference to `mbedtls_md5_starts'
c:/users/nae/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\libb7f\libESP Async WebServer.a(WebAuthentication.cpp.o): in function `getMD5(unsigned char*, unsigned short, char*)':
D:\__Document__\Study\Computing\Embedded\PlatformIO\WetWaterNet/.pio/libdeps/esp32dev/ESP Async WebServer/src/WebAuthentication.cpp:73: undefined reference
to `mbedtls_md5_starts'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\firmware.elf] Error 1
网上搜了下有一篇好像提到了相关的内容,解决方法是删掉一个文件夹,但是我删掉以后编译要下载回来,然后下载根本不动…
原文->https://blog.csdn.net/weixin_51139222/article/details/129022915
把库依赖从稳定版换成开发版platforn.ini里面改成这样↓
lib_deps =
https://github.com/me-no-dev/ESPAsyncWebServer.git
ESPAsyncWebServer项目地址https://github.com/me-no-dev/ESPAsyncWebServer?tab=readme-ov-file#installation
解决方法是自己瞎猜试出来的,因为貌似用稳定版的库是少了东西什么的,所以就看到项目的介绍里还有个开发版本的
(不过因为lib_deps =
后面填写的格式,也出问题好多次,具体就是加上后反而显示ESPAsyncWebServer.h找不到,多试了几次,问题应该只是我没设置对,变成没有添加这个库了)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。