ESP32 VScode platformIO错误

曾华翰
2023-12-01

ESP32 VScode PlatformIO :error adding symbols: no more archived filescollect2: error: ld returned 1 exit status***[.pio/build/esp32dev/firmware.elf] Error 1

**问题描述:**最近刚开始使用esp32 在用vscode中的platformIO进行项目编译时提示这个错误,在一番寻找之后得以解决,解决方法是删除一个文件夹重新build即可

错误代码:

/home/huangliangsheng/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /home/huangliangsheng/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/lib/no-rtti/libstdc++.a: error adding symbols: no more archived files
collect2: error: ld returned 1 exit status
*** [.pio/build/esp32dev/firmware.elf] Error 1

需要进入文件目录

/home/huangliangsheng/.platformio/packages/

删除其中文件夹:“/toolchain-xtensa-esp32/”

其中:文件夹所在位置根据个人提示信息进入;

删除后重新build显示文件编译成功:

Building .pio/build/esp32dev/firmware.bin
esptool.py v4.4
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
=================== [SUCCESS] Took 18.04 seconds ===================

解决方法转载自:

VSCode上的PlatformIO未编译: collect2.exe: error: ld返回%1退出状态 - 问答 - 腾讯云开发者社区-腾讯云 (tencent.com)

 类似资料: