The AVR-based Arduinos don't come with anything close to a full C++ standard library implementation. They have avr-libc which is fairly complete to at least the C99 standard, that is the C standard from 1999, not C++. What you're doing with -std=c++11
is influencing the standard used by the compiler to interpret the C++ language itself. This does work fine on AVR based Arduinos, but is not going to give you the sort of C++ containers you may be used to on a desktop or larger embedded system, like an ESP8266.
Much of the C++ standard library would be completely out of place on an AVR based Arduino, particularly those parts that make use of dynamic allocation like unordered_map
in your error message.
There are some parts of the C++ library implemented via Arduino STL. Whether or not you should be using containers from it is another question.
If you do try to use Arduino STL, I'd encourage you to use more conservative parts of it. Something like an unordered_map
, but with less (or no) dynamic allocation could be implemented by using Arduino STL's std::array
and functions from its <algorithm>
header, like their std::find
or std::lower_bound
, etc. Trying to use a C++ map
or vector
container or something of that sort is kind of asking for trouble, more so on the more common AVR-based Arduinos with only roughly 2 Kbyte of RAM.