Support for C++20 ranges

LeCyberDucky
Posts: 2
Joined: Thu Jan 11, 2024 8:08 pm

Support for C++20 ranges

Postby LeCyberDucky » Thu Jan 11, 2024 8:24 pm

Hello,

I'm working on a project for an ESP32-S3-based board (the LilyGo T-Display-S3), and I am facing problems trying to use the C++20 ranges library. Specifically, I get the error

Code: Select all

fatal error: ranges: No such file or directory

I'm using PlatformIO to develop this project, and I have already asked an initial question in the [PlatformIO forum](https://community.platformio.org/t/c-20 ... tory/37771), which has subsequently lead me here.

Anyway, I have since come across this seemingly similar issue about support for C++20 chrono: https://github.com/espressif/esp-idf/is ... 1873703047

It is mentioned that this will be supported starting with GCC14. A quick look at https://en.cppreference.com/w/cpp/compiler_support reveals that "The One Ranges Proposal" should be supported from GCC10. So, how does all of this fit together?

All of this has me quite confused, especially considering that I'm simply trying to port a project that works on an ESP8266. Could somebody explain to me what is going wrong, and if there's anything I can do to fix it?

In case it is of any interest, my PlatformIO.ini looks like this:

Code: Select all

[env:lilygo-t-display-s3]
; platform = espressif32
platform = https://github.com/platformio/platform-espressif32.git
board = lilygo-t-display-s3
framework = arduino
build_unflags = -std=gnu++11
build_flags = -std=gnu++2a //https://community.platformio.org/t/which-c-standard-am-i-using/24597/4
With that, I get the following information when trying to build my project:

Code: Select all

PACKAGES:
 - framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
 - tool-esptoolpy @ 1.40501.0 (4.5.1)
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
Best regards

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: Support for C++20 ranges

Postby lbernstone » Fri Jan 12, 2024 2:10 pm

That is something that would need to be supported by the toolchain.
You can ask the developers about that at https://github.com/espressif/crosstool-NG/issues

LeCyberDucky
Posts: 2
Joined: Thu Jan 11, 2024 8:08 pm

Re: Support for C++20 ranges

Postby LeCyberDucky » Sun Jan 14, 2024 7:21 pm

Thanks. I asked the developers this same question, and it seems that support is underway: https://github.com/espressif/crosstool-NG/issues/48

For now, I'm using a workaround in the form of a custom toolchain: https://github.com/Jason2866/platform-espressif32

Who is online

Users browsing this forum: MicroController and 63 guests