.vscode文件夹下创建文件c_cpp_properties.json
ctrl+shift+p,输入C/C++: Edit Configurations (JSON),回车
不同平台文件内容不同,主要是修改Standard版本,搞了半天才搞定。
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc", //编译器路径
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}