【codeblocks】error This file requires compiler and library support for the ISO C++ 2011 standard.

编译C++代码时出现了如下问题提示:
#error This file requires compiler and library support for the
ISO C++ 2011 standard. This support is currently experimental,
and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
在这里插入图片描述

在codeblocks上的解决方法:
设置(setting)—>编译器(compiler)—>选中下图中的选项后点击确定
在这里插入图片描述
在这里插入图片描述
选中该选项之后再对代码进行编译,亲测有效,编译成功!
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/lic1697067085/article/details/117108586