Compiling C 11 with g
When encountering compilation errors involving C 11 libraries, such as "#include
Using Flags to Enable C 11 Support
To enable C 11 support in g , use the following flag:
-std=c++11
This flag informs the compiler to adhere to the C 11 standard.
Compiling with C 11
To compile a C 11 program:
g++ -std=c++11 your_file.cpp -o your_program
Alternatively, if the previous command fails:
g++ -std=c++0x your_file.cpp -o your_program
By incorporating these flags into the compilation process, you can successfully compile and execute C 11 code.
The above is the detailed content of How Do I Compile C 11 Code Using g ?. For more information, please follow other related articles on the PHP Chinese website!