#include <iostream> 在 Visual Studio 代码中找不到 mingw64

#include <iostream> not found in Visual Studio Code with mingw64

我在 Win 10 上安装 'Visual Studio Code' 'C/C++ IntelliSense, debugging, and code browsing' 扩展并添加 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 headers 和 compiler/debugger 的包含路径。两者都正常工作,但 Intellisense 显示

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

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

对于 iostream,始终使用 "The source can't be open" 的波线。现在我正在寻找所有C和C++headers放在x86_64-8.1.0-posix-seh-rt_v6-rev0中的路径。如果我正在搜索例如stdlib.h 我得到了三个可能的路径,iostream 到底保存在哪里?谢谢...

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