Problem with C++ std lib for only avr based boards

I have a problem with my project where I want to use

#include <functional>
#include <map>

In platformio.ini I have two env

platform = atmelavr
board = nanoatmega328
framework = arduino
lib_deps = 

platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps = 

When I build with pcf_test_esp, everything is ok, build with pcf_test_arduino - failing with functional or map no such file or directory. Where try to find the problem?

Meaby I will find something in c_cpp_properties.json ?

The underlying AVR-G++ doesn’t support the full standard C++ library.

This issue has been around with their compiler forever and will probably never be fixed.

See e.g. topic Enabling RTTI (-frtti) causes undefined reference to `__dynamic_cast'

You may try adding

platform_packages = 

to the Atmel-AVR environment, to get a newer compiler, but I’m 99% certain the compiler will still fail.

@maxgerhardt thanks for that info, now I found something about this and I know where is the problem. I Tried with another version and nothing. I found the ArduinoSTL library and maybe this will help me.