为什么我的VSCODE检查C+ 17(我的编译器是Clang 12)?
此遵循
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include"
],
"defines": [],
"compilerPath": "/usr/bin/clang++-12",
"cStandard": "gnu11",
"cppStandard": "c++17",
"intelliSenseMode": "linux-clang-x64",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
我的远程C_CPP_PROPERTIES中的上下文。 VSCODE文件夹
设置。JSON:
"C_Cpp.default.cppStandard": "c++17",
"clang.cxxflags": [
"-std=c++17"
],
但是我的代码可以编译
This follow is my remote server and local vscode
this follow context
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include"
],
"defines": [],
"compilerPath": "/usr/bin/clang++-12",
"cStandard": "gnu11",
"cppStandard": "c++17",
"intelliSenseMode": "linux-clang-x64",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
in my remote c_cpp_properties.json under .vscode folder
settings.json:
"C_Cpp.default.cppStandard": "c++17",
"clang.cxxflags": [
"-std=c++17"
],
but my code can be compiled
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
此问题是因为有一个CMAKE工具插件,请在远程服务器中找到您的
compile_commands.json
文件,然后编辑以添加选项-STD = C ++ 17
;因此,将例如更改为
This problem is because of a cmake tool plugin, find your
compile_commands.json
file in your remote server, and edit to add the option-std=c++17
; thus, change e.g.to