有没有一种方法可以在SmingIDE(ESP8266)中使用std::map
Is there a way to use std::map in Sming IDE (ESP8266)?
我正在尝试在使用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(extenssa-lx106-elf-gcc)的ESP8266和std::映射链接错误应该将-lsdc++(可能还有-lsupc++)添加到要链接的库列表中。
但是在Sming的Makefile-project.mk中有-nostlib标志!
LDFLAGS = -nostdlib ...
如果我把它改为-lsdc++-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/建议如下:
请尝试使用-nostlib链接选项。
太棒了!
我试过使用arduino-esp8266中的extenssa-lx106-elfhttps://github.com/rogerclarkmelbourne/arduino-esp8266/tree/master/tools/xtensa-lx106-elf(它包括crt1sim.o、_vectors.o和其他libs),但没有帮助。
我还没有找到最终的答案:"如果有办法在Sming中使用std::map等等?"
提前感谢您的帮助。
最终构建它。最后一切都很简单。
我应该将stdc++supc++添加到LIBS,而不是添加到LDFLAGS即:
LIBS = stdc++ supc++ microc ...
并保持LDFLAGS不变(使用-nostlib)
LDFLAGS = -nostdlib ...
- 在执行其他功能的同时播放动画(LED矩阵和Arduino/ESP8266)
- 使用std::multimap迭代器创建std::list
- C++中std::resize(n)和std::shrink_to_fit之间的区别
- 来自 std::list 的迭代器 .end() 按预期返回"0xcdcdcdcdcdcdcdcd"但 .begin()
- C++17复制构造函数,在std::unordereded_map上进行深度复制
- 如何导出包含具有"std::unique_ptr"值的"std::map"属性的
- 从持续时间构造std::chrono::system_clock::time_point
- std::具有相同基类的类的变体
- std::向量与传递值的动态数组
- 使用std::vector的OpenCL矩阵乘法
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- std::condition_variable::wait()如何评估给定的谓词
- 如何获取std::result_of函数的返回类型
- std::原子加载和存储都需要吗
- 将对象移动到std::shared_ptr
- POCO::PostgreSQL:如何将std::vector支持添加到`Binder::bind`
- 使用一个考虑到std::map中键值的滚动或换行的键
- 如何从 std::atomic 中提取指针 T<T>?
- 用于Arduino IDE的ESP8266(extenssa-lx106-elf-gcc)和std::映射链接错误
- 有没有一种方法可以在SmingIDE(ESP8266)中使用std::map