I was going to update this question but I thought that this was different.

I have been trying to get std::vector to work with the latest Arduino. I have tried downloading several libraries found online but I can not get one of them to compile correctly. So here is my question, does anyone CURRENTLY know of a Arduino STL Library that is working?

StandardCplusplus: As stated above I tried to use this library but run into problems with the new/delete functions.

Andy Brown's AVR-STL Library doesn't even seem to come close to compiling.

If anyone has a working copy of these two I would love to have a copy or if you can tell me how to get them to compile. Otherwise I really need to find a way to get Vectors working, does anyone have any ideas?


I didn't want to answer this question so it is still active as I am sure there will be additions to this. Anyways I FINALLY got a library to work (for now, so far). I downloaded the StandardCplusplus library and found that in order to get any of the stl functions to work you have to add an include to the "StandardCplusplus.h" file before EVERY use, not just in the first file as stated in the Wiki on the Project page.

So I was able to get vectors to work using the following:

#include "StandardCplusplus.h"
#include <iterator>
#include <vector>

vector<int> test;

void setup(){


void loop(){
   for (int i = 0; i < test.size(); i++){

I would still like to know of other working STL Libraries as it seems that there are tons of outdated and old libraries out there.

  • I was wondering the same. At school, we once used the "GNU-GCC" toolchain to cross-compile for AVR targets. We could use all fancy vector & queue things, but I'm uncertain if it required any additional steps (which I forgot).
    – Paul
    May 16, 2016 at 19:40
  • You may try the original C++ libraries? They would be poorly optimized though, but I'm curious if they will perform reasonable. C++ should be portable to other platforms, though, microcontrollers do have their limits.
    – Paul
    May 16, 2016 at 19:44
  • @Paul I really am not sure were to start trying to port the original libraries, I am pretty new to Arduino and AVR Programming and I am still feeling out the limitations. I do know however that other people have been successful in using vector and other STL functions. I just have to figure out how to do it repeatably. Another thing I noticed when using the above library I get intermittent compiler errors so I am thinking that there are still issues. May 17, 2016 at 12:17
  • 2
    You are probably having a hard time finding good libraries because dynamic memory is rarely used on micro controllers with such small amounts of RAM
    – BrettAM
    May 17, 2016 at 16:43
  • 1
    @AndyBraham. Those old 286 machines had MMU, multilevel interrupts, 1 MB addressable memory (DOS, real mode), DMA transfer, 16 bits registers, separate address and data buses and FPU (via co-processor).
    – user31481
    Oct 20, 2017 at 12:11

2 Answers 2


I maintain an Arduino plugin that's a port of uClibc++ (just like the defunct StandardCplusplus library). It's available in the Arduino library manager for Arduino versions 1.6.10 and higher. It's called ArduinoSTL.

  • Thank you for the suggestion but I am running into a problem with your library. I simply tried to include the "ArduinoSTL.h" file into a blank sketch but I receive a error in iterator.cpp "The system cannot find the file specified.". Any idea what file might be missing from my setup? I am using Eclipse Neon Nov 6, 2016 at 13:49
  • You must include it via Arduino's GUI Sketch -> Include Library -> ArduinoSTL. If it's not in the list you can install it from the built-in library mager: Sketch -> Include Library -> Manage Libraries... Feb 14, 2017 at 4:06
  • Pity there's no C++11. Your <type_traits> header is lacking great many functions. Jan 25, 2018 at 6:31
  • It's a pity it doesn't compile, at least with PlatformIO 5.0.2 and Atmel megaAVR 1.3.0. I get an error that In file included from .pio/libdeps/nano_every/ArduinoSTL/src/ArduinoSTL.h:12:0, from .pio/libdeps/nano_every/ArduinoSTL/src/ArduinoSTL.cpp:1: .pio/libdeps/nano_every/ArduinoSTL/src/serstream:307:9: error: '::Stream' has not been declared Nov 14, 2020 at 13:06

pay you attention which kind of arduino do you use. it can compile for Mega but not for Leonardo for example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.