VS代码:名称空间“ STD”没有成员的“格式”消息,但它编译了

发布于 2025-02-06 19:01:51 字数 943 浏览 1 评论 0原文

我已经在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乞讨 2025-02-13 19:01:51

VS代码创建.vscode使用文件c_cpp_properties.json的文件夹。

更改行“ CPPSTANDARD”:“ C ++ 17”,“ cppstandard”:“ C ++ 20”,启用C ++ 20的Intellisense。

VS Code creates a .vscode folder with a file c_cpp_properties.json.

Changing the line "cppStandard": "c++17", to "cppStandard": "c++20", enables IntelliSense for C++20.

不知所踪 2025-02-13 19:01:51

我面临同样的问题。我添加了“ 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.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文