PlatformIO Community

C++17 is unrecognized build flag


#1

this is my platformio.ini file:

[env:adafruit_itsybitsy_m4]
platform = atmelsam
board = adafruit_itsybitsy_m4
framework = arduino
lib_deps = 
    https://github.com/davidbitton/legilimens.git
    https://github.com/davidbitton/senoval.git
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!


#2

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

extra_script.py

Import("env")

env.Append(CCFLAGS=["-std=c++17"])