Skip to content

Rebuild libstdc++ with mlongcalls and include it in linker command line #1983

Closed
@srwi

Description

@srwi

Problem description

The code below gives me a weird linker error. The C++ code itself should be fine so maybe it is caused by some conflict with Arduino-ESP8266 related libraries that I'm not aware of? Are lists not supported on the ESP8266? I am compiling the sketch for the Generic ESP8266 Module.

Sketch

#include <list>

void setup () {
  std::list<int> mylist;
  mylist.push_back(0);
}

void loop() {

}

Error Message

sketch\sketch_apr28a.ino.cpp.o:(.text.setup+0x0): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'

sketch\sketch_apr28a.ino.cpp.o: In function `construct<std::_List_node<int>, int>':

[...]\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\ext/new_allocator.h:120: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'

collect2.exe: error: ld returned 1 exit status

exit status 1

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions