set platformio to C++14
To set the platformio to C++14 in the C++ language, you need to follow these steps:
- Open your project in the PlatformIO IDE or text editor of your choice.
- Locate the
platformio.ini
file in the root directory of your project. - Open the
platformio.ini
file. - In the
[env]
section, add the following line:build_flags = -std=c++14
- Save the
platformio.ini
file.
Explanation:
- The
platformio.ini
file is a configuration file that contains settings for your PlatformIO project. - The
[env]
section in theplatformio.ini
file is where you can specify environment-specific settings for your project. - The
build_flags
option allows you to pass additional compiler flags to the build process. -std=c++14
is the flag that tells the compiler to use the C++14 standard for compiling your code. C++14 is a version of the C++ programming language that was standardized in 2014 and introduced several new features and improvements over previous versions.- Saving the
platformio.ini
file ensures that the changes you made take effect.
By following these steps and adding the build_flags = -std=c++14
line in the [env]
section of the platformio.ini
file, you are instructing the PlatformIO build system to compile your C++ code using the C++14 standard.