Page 1 of 1

Compile C++14 and newer.

Posted: Thu Dec 10, 2020 7:04 am
by Viktor
Hi.
I assume that it's possible to build with different compiler options. I see that my code is compiled with -std=gnu++11 by default.
I found some comments about changing c++ version: https://github.com/espressif/esp-idf/is ... -423867023
But both

Code: Select all

CFLAGS += -std=c++14
and

Code: Select all

component_compile_options(-std=c++14)
don't work in my case, I think. I still see -std=gnu++11 in ESP-IDF command prompt during compilation before component filenames and errors in that files.
What's wrong with my configuration?
ESP-IDF v4.1. ESP32 project.

Re: Compile C++14 and newer.

Posted: Sun Dec 13, 2020 2:07 pm
by ESP_Jan
Hi Viktor,
take a look at https://docs.espressif.com/projects/esp ... ompilation

This describes how to apply compilation flags to specific source files.

Please note that compiling ESP-IDF using different compile flags may not be supported. However you can compile only your code using those flags.

Feel free to post any follow-up questions.