使得VSCoder 支持 C++ 11 的特性
最近在使用VSCoder开启C++多线程出现如下报错
error: #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. #error This file requires compiler
and library support for the \
大概意思就是要支持 C++ 11
的新标准
也很简单,稍微改一下 settings.json
的文件就行,不过要从 Code Runner
这个插件进入
具体步骤如下
-
点击扩展设置
-
找到
Executor Map
点击在
settings.json
中编辑 -
在 "code-runner.executorMap"中 找到
"cpp"
的这一行在 $fileNameWithoutExt 的后面添加
-std=c++11
保存后即可食用保存之后
重新编译运行
新编译运行
[外链图片转存中…(img-DCW3EbqT-1620662297548)]