gpt4 book ai didi

c++ - 无法打开源文件 "crtdbg.h"(依赖于 "iostream")C/C++(1696)

转载 作者:行者123 更新时间:2023-12-04 12:56:22 80 4
gpt4 key购买 nike

我正在使用 VSCode 并且代码使用 .run 扩展名编译得很好,但是 C/C++ 扩展向我抛出了这个错误并加了下划线 #include <iostream>作为错误。是的,我的系统中安装了 MinGW。
此外,我在 Visual Studio 社区 2019 上遇到了同样的错误,它根本没有在那里执行。
系统:Windows 10 Version 10.0.19042 Build 19042
VSCode 版本:1.54.1
gcc 版本:8.1.0
Visual Studio 社区版本:16.8.5(只是用来检查问题是由于 VSCode 还是系统错误)
扩展显示错误:C/C++ for Visual Studio Code v1.2.2
我用来运行代码的扩展:Code Runner v0.11.3

最佳答案

  • 将鼠标悬停在显示错误
  • 的行上
  • 左键单击灯泡,它将带您进入 C/C++ 配置
  • 现在将编译器路径更改为 C:/MinGW64/bin/g++.exe
  • 在顶部你会看到一个链接 c_cpp_properties.json 点击它
  • 在 c_cpp_properties.json "intelliSenseMode": "windows-gcc-x64"

  • 这很好用。

    关于c++ - 无法打开源文件 "crtdbg.h"(依赖于 "iostream")C/C++(1696),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66585784/

    80 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com