Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By lukegluke
#51423 Hi all.

I'm trying to use std::map<Key, Value> in Sming 2.1.0 application.
I've got following building error:
Code: Select allundefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'

According to this viewtopic.php?p=40593 one should add -lstdc++ (and potentially -lsupc++) to the list of libraries to link with.

But in Makefile-project.mk in Sming there is -nostdlib flag!
Code: Select allLDFLAGS   = -nostdlib ...

If I change it to -lstdc++ -lsupc++ I've got those errors instead:
Code: Select allc:/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

And to solve this here https://www.reddit.com/r/esp8266/commen ... rd_errors/ recommended following:
Code: Select allTry using the -nostdlib link option.

Excellent!
After all, I haven't find final answer: "If there any way to use std::map in Sming?"

Thank you in advance for help.