Using C++20 with ESP32S3
Posted: Fri Feb 28, 2025 1:13 pm
by avsteele
How can I enable cpp20 usage for Arduino framework code which uses the c++20 standard? Right now the latest I can get it to do is 2017 (what the __cplusplus macro reports). See attached image showing a c++20 feature which make it unable to compile.
I typically use PlatformIO in VSCode but am open to other solutions as well.
Re: Using C++20 with ESP32S3
Posted: Thu Mar 06, 2025 10:48 pm
by chegewara
Code: Select all
build_unflags = -std=gnu++11
build_flags =
-std=gnu++20
Im not sure if its working for C++20 but worked for C++17 for sure.
Re: Using C++20 with ESP32S3
Posted: Wed Mar 19, 2025 9:27 am
by kondalkolipaka
Hello,
As you’ve asked for other solutions, you can also think about ESP-IDF for your development, and we have VSCode extension for it and it supports latest C++ version as well.
By default, ESP-IDF compiles C++ code with C++23 language standard with GNU extensions (-std=gnu++23).
https://docs.espressif.com/projects/esp ... e-standard
Thanks