PlatformIO Community

C++17 is unrecognized build flag


this is my platformio.ini file:

platform = atmelsam
board = adafruit_itsybitsy_m4
framework = arduino
lib_deps =
build_flags =
    -Wall -std=c++17

which results in

arm-none-eabi-g++: error: unrecognized command line option '-std=c++17'

I ran this from the command line:

$ arm-none-eabi-g++ -std=c++17
arm-none-eabi-g++: fatal error: no input files
compilation terminated.

and while I had nothing to compile, I had no unknown command error. Is PlatformIO using it’s own version of the compiler? What do I need to do to compile with c++17? Thanks!


Could you try Advanced Scripting and pass flag directly yo GCC/G++?