【问题标题】:#include <iostream> not found in Visual Studio Code with mingw64#include <iostream> 在带有 mingw64 的 Visual Studio Code 中找不到
【发布时间】:2020-08-15 17:38:24
【问题描述】:

我在 Win 10 的“Visual Studio Code”中安装了“C/C++ IntelliSense、调试和代码浏览”扩展,并添加了 c_cpp_properties.json

{
    {
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "E:\\PROGRAMS\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\x86_64-w64-mingw32\\include\\**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "E:\\PROGRAMS\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gcc.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64",
            "compilerArgs": [
                "-j"
            ]
        }
    ],
    "version": 4
}

C 头文件和编译器/调试器的包含路径。两者都正常工作,但 Intellisense 向我显示

#include "head1.h"
#include <stdlib.h>
#include <stdio.h>
#include <iostream> -> wavelines

int main() {
    printf("Hello World\n");
}

对于 iostream,总是带有“无法打开源”的波形。现在我正在寻找将所有 C 和 C++ 头文件放置在 x86_64-8.1.0-posix-seh-rt_v6-rev0 中的路径。如果我正在寻找例如stdlib.h 我得到了三个可能的路径,iostream 到底保存在哪里?谢谢...

【问题讨论】:

    标签: c++ visual-studio-code windows-10 mingw-w64


    【解决方案1】:

    刚刚找到方法。完全卸载 C/C++ 扩展,包括。刷新并重启 Visual Studio Code,然后新建 tasks.json 和 launch.json 文件,不带任何包含路径。

    【讨论】:

      猜你喜欢
      • 2012-04-20
      • 1970-01-01
      • 2021-11-19
      • 2020-07-20
      • 1970-01-01
      • 1970-01-01
      • 2018-03-26
      • 1970-01-01
      • 2021-06-05
      相关资源
      最近更新 更多