VS代码:名称空间“ STD”没有成员的“格式”消息,但它编译了
我已经在Visual Studio 2022中编写了一些代码,然后将其复制到VS代码,以将其编译为节点模块。我在Visual Studio中没有错误,但是在VS代码中获得以下错误:
namespace“ std”没有成员“格式” C/C ++(135)
。
该代码没有错误编译,并且可以正常工作,但是我的工作区被错误消息污染。
如果有人可以指出消息的原因,当然还有如何抑制它们,我将不胜感激。
这是一个详细的编译器信息:
> node-gyp rebuild -j max && set_modules && tsc && node ./final/index.js
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.10.2 found at "C:\Python310\python.exe"
gyp info find VS using VS2022 (17.2.32519.379) found at:
gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
I have written some code in Visual Studio 2022 that I then copy over to VS Code in order to compile it to a node module. I get no errors in Visual Studio, but get the following error in VS Code:
namespace "std" has no member "format" C/C++(135)
.
The code compiles without errors and works fine, but my workspace is polluted with error messages.
I would appreciate it if someone could point me to the cause of the messages and of course how to suppress them.
Here is a detailed compiler information:
> node-gyp rebuild -j max && set_modules && tsc && node ./final/index.js
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.10.2 found at "C:\Python310\python.exe"
gyp info find VS using VS2022 (17.2.32519.379) found at:
gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
VS代码创建
.vscode
使用文件c_cpp_properties.json
的文件夹。更改行
“ CPPSTANDARD”:“ C ++ 17”,
为“ cppstandard”:“ C ++ 20”,
启用C ++ 20的Intellisense。VS Code creates a
.vscode
folder with a filec_cpp_properties.json
.Changing the line
"cppStandard": "c++17",
to"cppStandard": "c++20",
enables IntelliSense for C++20.我面临同样的问题。我添加了
“ C_CPP.DEFAULT.CPPSTANDARD”:“ C ++ 20”
.vscode/street.json
for this Inspory并解决了它。I faced same issue. I added
"C_Cpp.default.cppStandard": "c++20"
to.vscode/setting.json
for this issue and solved it.