最近在研究正则表达式的时候,在vscode调试代码,包含了
#include <bits/stdc++.h>
#include <regex>
头文件,编译的时候出现错误,提示#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"],
编译顺利通过,哈哈