Build error on MacOs but not on Windows

Hi,

I have a project that build with success on windows but not on MacOs

I have to build the project with C++17

My platformio.ini file

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:seeed_xiao]
platform = atmelsam
board = seeed_xiao
framework = arduino
monitor_speed = 115200
lib_deps = 
	bxparks/AceButton@^1.9.2
	adafruit/Adafruit GFX Library@^1.11.3
	adafruit/Adafruit SH110X @ ^2.1.8
	adafruit/SD@0.0.0-alpha+sha.041f788250
build_flags =
	-std=c++17
	-std=gnu++17
	-fexceptions
build_unflags =
	-std=gnu++11

The build log:

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/seeed_xiao.html
PLATFORM: Atmel SAM (8.1.0) > Seeeduino XIAO
HARDWARE: SAMD21G18A 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink)
PACKAGES: 
 - framework-arduino-samd-seeed @ 1.8.1 
 - framework-cmsis @ 2.50400.181126 (5.4.0) 
 - framework-cmsis-atmel @ 1.2.2 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 21 compatible libraries
Scanning dependencies...
Dependency Graph
|-- AceButton @ 1.10.1
|-- Adafruit GFX Library @ 1.11.5
|-- Adafruit SH110X @ 2.1.8
|-- SD @ 0.0.0-alpha+sha.041f788250
|-- Bb
Building in release mode
Compiling .pio/build/seeed_xiao/src/main.cpp.o
In file included from /Users/louis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/cstdlib:41:0,
                 from /Users/louis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/stdlib.h:36,
                 from /Users/louis/.platformio/packages/framework-arduino-samd-seeed/cores/arduino/Arduino.h:25,
                 from src/main.cpp:1:
/Users/louis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/bits/stl_vector.h:581:12: error: expected ';' at end of member declaration
       end()_GLIBCXX_NOEXCEPT volatile
            ^
In file included from /Users/louis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/vector:64:0,
                 from lib/TinyExpr/tinyexpr.h:53,
                 from lib/Bb/formulaHelper.h:5,
                 from lib/Bb/displayHelper.h:5,
                 from src/main.cpp:3:
/Users/louis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/bits/stl_vector.h:582:7: error: expected unqualified-id before '{' token
       { return iterator(this->_M_impl._M_finish); }
       ^
Compiling .pio/build/seeed_xiao/lib43e/TinyExpr/tinyexpr.cpp.o
Compiling .pio/build/seeed_xiao/FrameworkArduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src/device/usbd_control.c.o
In file included from /Users/louis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/bits/stl_algobase.h:59:0,
                 from /Users/louis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/vector:60,
                 from lib/TinyExpr/tinyexpr.h:53,
                 from lib/TinyExpr/tinyexpr.cpp:50:
/Users/louis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/bits/stl_vector.h:581:12: error: expected ';' at end of member declaration
       end()_GLIBCXX_NOEXCEPT volatile
            ^
In file included from /Users/louis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/vector:64:0,
                 from lib/TinyExpr/tinyexpr.h:53,
                 from lib/TinyExpr/tinyexpr.cpp:50:
/Users/louis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/bits/stl_vector.h:582:7: error: expected unqualified-id before '{' token
       { return iterator(this->_M_impl._M_finish); }
       ^
Compiling .pio/build/seeed_xiao/FrameworkArduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src/portable/dialog/da146xx/dcd_da146xx.c.o
Compiling .pio/build/seeed_xiao/FrameworkArduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src/portable/espressif/esp32s2/dcd_esp32s2.c.o
Compiling .pio/build/seeed_xiao/FrameworkArduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src/portable/microchip/samd/dcd_samd.c.o
Compiling .pio/build/seeed_xiao/FrameworkArduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src/portable/microchip/samg/dcd_samg.c.o
Compiling .pio/build/seeed_xiao/FrameworkArduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c.o
*** [.pio/build/seeed_xiao/src/main.cpp.o] Error 1
Compiling .pio/build/seeed_xiao/FrameworkArduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src/portable/nuvoton/nuc120/dcd_nuc120.c.o
Compiling .pio/build/seeed_xiao/FrameworkArduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src/portable/nuvoton/nuc121/dcd_nuc121.c.o
*** [.pio/build/seeed_xiao/lib43e/TinyExpr/tinyexpr.cpp.o] Error 1

Weird to see both being set, please only chose one.

Tried with both but neither of it works

got the same error

Does it use the same versions on Mac or an older one?

Here’s the output of the Windows build with exactly the same platformio.ini

Processing seeed_xiao (platform: atmelsam; board: seeed_xiao; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/seeed_xiao.html
PLATFORM: Atmel SAM (8.1.0) > Seeeduino XIAO
HARDWARE: SAMD21G18A 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink)
PACKAGES:
 - framework-arduino-samd-seeed @ 1.8.1
 - framework-cmsis @ 2.50400.181126 (5.4.0)
 - framework-cmsis-atmel @ 1.2.2
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 21 compatible libraries
Scanning dependencies...
Dependency Graph
|-- AceButton @ 1.10.1
|-- Adafruit GFX Library @ 1.11.5  
|-- Adafruit SH110X @ 2.1.8        
|-- SD @ 0.0.0-alpha+sha.041f788250
|-- TinyExpr
|-- Bb
|-- TimerTC3
Building in release mode
Checking size .pio\build\seeed_xiao\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  12.4% (used 4056 bytes from 32768 bytes)
Flash: [===       ]  34.3% (used 90012 bytes from 262144 bytes)
======================================================================================== [SUCCESS] Took 3.56 seconds ========================================================================================
 *  Terminal will be reused by tasks, press any key to close it. 

Can you delete that whole folder so that the toolchain is downloaded anew at the next build?

Yay ! working now, thank u mate