Do the following steps:
Check where the C++ compiler is located by doing the following within CodeBlocks:
Open CodeBlocks
Menu > Settings > Compiler
Selected compiler: GNU GCC Compiler
Tab the "Toolchain executables"
Copy the path from the textfield "Compiler's installation directory"
Open command prompt window
Change directory to the directory given, then change directory to the bin subdirectory
> cd C:\Program Files\CodeBlocks\MinGW
> cd bin
Run g++ -v
> g++ -v
gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)
gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)
Search GCC 8.1 manual of online documents from internet
Example is at https://gcc.gnu.org/onlinedocs/8.1.0/
Click the link "GCC 8.1 Manual"
Go to the Table of Contents section, click the link "C++ Language"
Online documentation information from the "C++ Language" section: The default, if no C++ language dialect options are given, is -std=gnu++14.
CodeBlocks Compiler Flag: leave this box untick: Have g++ follow the C++14 GNU C++ language standard (ISO C++ plus GNU extensions).
No comments:
Post a Comment