#error This file requires compiler and library support for the ISO C++ 2011错误解决办法

最近在研究正则表达式的时候,在vscode调试代码,包含了

#include 

#include 

头文件,编译的时候出现错误,提示#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.

同时显示Unable to open 'c++0x_warning.h,这个头文件。

解决方法是在tasks.json文件里的args参数项里增加一项"-std=c++11"

增加前:"args": ["-g","${file}","-o","${fileBasenameNoExtension}.exe"],   

增加后:"args": ["-g","-std=c++11","${file}","-o","${fileBasenameNoExtension}.exe"],   

编译顺利通过,哈哈

你可能感兴趣的:(c++基础知识,vscode,c++,正则表达式)