You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法覆盖Visual Studio Code默认设置:cppStandard被重置为空

C标准被自动从c17清空的问题

最近在VS Code的输出窗口里看到这条提示:

For C++ source files, the cppStandard was changed from "c++17" to "".

我试过在以下三个设置文件里添加"C_Cpp.default.cppStandard": "c++17"来修复:

  • 文件夹设置JSON
  • 工作区设置JSON
  • 用户设置JSON

操作方式是按Ctrl+Shift+P,选择对应选项(比如"Preferences: Open User/Workspace/Folder Settings (JSON)")打开JSON文件编辑。

但重启VS Code后还是会弹出同样的提示。之前一切正常,参数都设置好了,怀疑是VS Code的新bug。

当前使用的ms-vscode.cpptools扩展版本是1.18.5。我的.vscode/c_cpp_properties.json内容如下:

{
    "configurations": [
    {
      "name": "Linux",
      "includePath": ["${workspaceFolder}/**"]
    }],
    "version": 4
}

VS Code版本信息:

Version: 1.84.1
Commit: 2b35e1e6d88f1ce073683991d1eff5284a32690f
Date: 2023-11-06T12:35:31.181Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 5.8.0-43-generic

内容的提问来源于stack exchange,提问作者CleanCoder265

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 02:33:22