Errors when linking against libstdc++
![Post Post](./styles/FLATBOOTS/imageset/icon_post_target.gif)
Hi,
I received a couple of ESP-01 boards last week and started playing around with them. I installed the esp-open-sdk and compiled the toolchain. I have since compiled a few pure C examples and wrote a few on my own as well with success.
Lately I decided to up my game and try to get something up and running based on C++. The example I am trying to compile right now uses std::string and std::function. Whenever I try to add libstdc++ as an additional library, the linker complains that section `.text' will not fit in region `iram1_0_seg'.
Looking at the map file, all libstdc++ object do indeed seem to end up in the iram1_0 segment. I am not completely familiar with the memory space layout of the ESP8266, but from what I get from reading this forum, one can choose to place its code directly in iram1_0_seg or in irom0_0_seg where it will be loaded and cached in ram on demand. Is there a way to have the libstdc++ objects place in irom0_0_seg?
Is there a working example somewhere of a project leveraging the c++ standard library that I could start from?
I am attaching my Makefile for completeness.
Thanks in advance.
I received a couple of ESP-01 boards last week and started playing around with them. I installed the esp-open-sdk and compiled the toolchain. I have since compiled a few pure C examples and wrote a few on my own as well with success.
Lately I decided to up my game and try to get something up and running based on C++. The example I am trying to compile right now uses std::string and std::function. Whenever I try to add libstdc++ as an additional library, the linker complains that section `.text' will not fit in region `iram1_0_seg'.
Looking at the map file, all libstdc++ object do indeed seem to end up in the iram1_0 segment. I am not completely familiar with the memory space layout of the ESP8266, but from what I get from reading this forum, one can choose to place its code directly in iram1_0_seg or in irom0_0_seg where it will be loaded and cached in ram on demand. Is there a way to have the libstdc++ objects place in irom0_0_seg?
Is there a working example somewhere of a project leveraging the c++ standard library that I could start from?
I am attaching my Makefile for completeness.
Thanks in advance.