Hello,
I'm tinkering with a Teensy 3.6 and c++ and I'm wondering about the following:
It's perfectly fine in my project to use std::vector, since the toolchain includes libstdc++. But when trying even the simplest things with for example std::string and std::deque or even some operations with a std::unique_ptr, I get linker errors.
Consider this simple example:
Compiling works fine but linking results in this error:
What am I missing here? What do I have to do, to get this elements of the c++ standard library to work?
I found some guidance in another forum post (https://forum.pjrc.com/threads/23467-Using-std-vector?p=69787&viewfull=1#post69787), but unfortunately modifying the boards.txt file has no effect.
I'm tinkering with a Teensy 3.6 and c++ and I'm wondering about the following:
It's perfectly fine in my project to use std::vector, since the toolchain includes libstdc++. But when trying even the simplest things with for example std::string and std::deque or even some operations with a std::unique_ptr, I get linker errors.
Consider this simple example:
Code:
#include <string>
std::string str = "abc";
void setup() {
}
void loop () {
}
Compiling works fine but linking results in this error:
Code:
/home/marc/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x12): undefined reference to `_write'
collect2: error: ld returned 1 exit status
What am I missing here? What do I have to do, to get this elements of the c++ standard library to work?
I found some guidance in another forum post (https://forum.pjrc.com/threads/23467-Using-std-vector?p=69787&viewfull=1#post69787), but unfortunately modifying the boards.txt file has no effect.