Skip to content

std::list fails to link #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sticilface opened this issue Jan 9, 2017 · 3 comments
Closed

std::list fails to link #121

sticilface opened this issue Jan 9, 2017 · 3 comments

Comments

@sticilface
Copy link
Contributor

see error

/var/folders/nv/8j3v5v0s18v7p4249kv8qbz80000gq/T/arduino_build_469322/sketch/sketch_jan09b.ino.cpp.o:(.literal.setup+0x4): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
/var/folders/nv/8j3v5v0s18v7p4249kv8qbz80000gq/T/arduino_build_469322/sketch/sketch_jan09b.ino.cpp.o: In function `setup':
/Users/amelvin/git/arduino-esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/4.8.5/bits/stl_list.h:114: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board ESP32 Dev Module.

code example

#include <list>

class abc {
public:

private:
};

std::list<abc*> _list;

void setup() {
  abc * coolptr; 
  _list.push_back( coolptr ) ; 
}

void loop() {
  // put your main code here, to run repeatedly:

}
@jkearneyma
Copy link

I found that adding ' -lstdc++' at the end of 'compiler.c.elf.libs=' in platform.txt fixed this.

@sticilface
Copy link
Contributor Author

sticilface commented Jan 10, 2017

and indeed that did fix it! cheers. i'll leave it open as an issue to fix.
The memory on this thing is impressive!!

@me-no-dev
Copy link
Member

that is merged now so closing :)

brentru pushed a commit to adafruit/arduino-esp32 that referenced this issue Oct 22, 2024
Fix typerror in install_platform with AVR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants