MDashdotdashn
New member
Hi All,
I'm trying to use std::vector in a project I'm doing. This part of code is non-critical and the usage of std::vector makes the code a lot more readable than any 'custom' made solution.
However, as soon as I try to use std::vector<T>::insert() , the linker complains
SynthController.cpp.o: In function `std::vector<unsigned char, std::allocator<unsigned char> >::_M_check_len(unsigned int, char const*) const':
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/c++/4.7.2/bits/stl_vector.h:1306: undefined reference to `std::__throw_length_error(char const*)'
collect2: error: ld returned 1 exit status
From what I can gather, it seems that exception handling isn't linked with the rest, which makes sense because everything is compiled with exception disabled.
What puzzles me is that from what I can read, there is a way to use STL with exception disabled and this should be automatically done when specifying no exception support from gcc.
Any idea on how to solve this or should I write an equivalent container myself ?
Thanks
Marc
I'm trying to use std::vector in a project I'm doing. This part of code is non-critical and the usage of std::vector makes the code a lot more readable than any 'custom' made solution.
However, as soon as I try to use std::vector<T>::insert() , the linker complains
SynthController.cpp.o: In function `std::vector<unsigned char, std::allocator<unsigned char> >::_M_check_len(unsigned int, char const*) const':
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/c++/4.7.2/bits/stl_vector.h:1306: undefined reference to `std::__throw_length_error(char const*)'
collect2: error: ld returned 1 exit status
From what I can gather, it seems that exception handling isn't linked with the rest, which makes sense because everything is compiled with exception disabled.
What puzzles me is that from what I can read, there is a way to use STL with exception disabled and this should be automatically done when specifying no exception support from gcc.
Any idea on how to solve this or should I write an equivalent container myself ?
Thanks
Marc