我是靠谱客的博主 虚心猎豹,这篇文章主要介绍GCC编译时使用C++11standard,现在分享给大家,希望可以做个参考。

当使用GCC编译时如果代码中使用了C++11的标准,如果只用gcc -o就会提示错误。

复制代码
1
2
3
4
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support ^

当使用GCC编译时,如果需要使用C++11的标准去编译。就需要在编译时指令中加入-std=c++11

复制代码
1
g++ -std=c++11 -o main main.cpp

最后

以上就是虚心猎豹最近收集整理的关于GCC编译时使用C++11standard的全部内容,更多相关GCC编译时使用C++11standard内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(54)

评论列表共有 0 条评论

立即
投稿
返回
顶部