Compile C++14 and newer.

Viktor
Posts: 10
Joined: Mon Nov 30, 2020 10:48 am

Compile C++14 and newer.

Postby Viktor » Thu Dec 10, 2020 7:04 am

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.

ESP_Jan
Posts: 42
Joined: Tue Dec 01, 2020 10:56 am

Re: Compile C++14 and newer.

Postby ESP_Jan » Sun Dec 13, 2020 2:07 pm

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.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], jsmith56x and 276 guests