ESP8266 for Arduino IDE (xtensa-lx106-elf-gcc) and std::map linking error

梦想的初衷 提交于 2019-12-01 20:02:16

The standard ESP8266 setup does not link against libstdc++, which provides map and other std namespace code.

You'll need to edit platforms.txt in the root of the ESP8266 Arudino folder (The location of this folder depends on what was used to install it, and what OS you are using) - and add -lstdc++ to the following line:

compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig -lwps -lcrypto -laxtls

Arduino IDE only reads this file once at start, so, make sure to restart the IDE before compiling.

if it still doesnt work (because libstdc++ is incomplete for your toolchain), get the source at https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/src/c++98/tree.cc and rename it to tree.cpp. This worked for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!