繁体   English   中英

#包括<iostream>在带有 mingw64 的 Visual Studio Code 中找不到</iostream>

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

我在 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/C++ 扩展,包括。 刷新并重新启动 Visual Studio Code,然后新建 tasks.json 和 launch.json 文件,没有任何包含路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM