Sming 2.1.0 (Windows 7 SP1) で開発している ESP8266 ファームウェアで std::map を使用しようとしています。次のエラーがあります。
undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
このhttp://www.esp8266.com/viewtopic.php?p=40593およびArduino IDE 用のこの ESP8266 (xtensa-lx106-elf-gcc) および std::map リンク エラーによると、-lstdc++ を追加する必要があります (潜在的には-lsupc++) をリンクするライブラリのリストに追加します。
しかし、Sming の Makefile-project.mk には -nostdlib フラグがあります。
LDFLAGS = -nostdlib ...
-lstdc++ -lsupc++ に変更すると、代わりにこれらのエラーが発生します。
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: cannot find crt1-sim.o: No such file or directory
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: cannot find _vectors.o: No such file or directory
ここでこれを解決するには、https ://www.reddit.com/r/esp8266/comments/3pmyx8/trying_to_link_but_getting_weird_errors/以下をお勧めします:
-nostdlib リンク オプションを使用してみてください。
素晴らしい!
arduino-esp8266 から xtensa-lx106-elf を使用しようとしました https://github.com/rogerclarkmelbourne/arduino-esp8266/tree/master/tools/xtensa-lx106-elf (crt1-sim.o、_vectors が含まれます) .o およびその他のライブラリ) でも役に立ちません。
最終的な答えが見つかりませんでした:「Sming で std::map などを使用する方法はありますか?」
助けてくれてありがとう。