Search code examples
c++visual-studio-codewindows-10mingw-w64

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


I installed on Win 10 in 'Visual Studio Code' the 'C/C++ IntelliSense, debugging, and code browsing' extension and add in 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
}

the includepath for the C headers and the compiler/debugger. Both are working correctly, but Intellisense shows me

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

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

for iostream always the wavelines with "The source can't be open". Now I'm looking for the path where all C and C++ headers are placed in x86_64-8.1.0-posix-seh-rt_v6-rev0. If I'm searching for e.g. stdlib.h I'm getting three possible pathes and where is iostream exactly saved? Thxs...


Solution

  • Just found a way. Completely deinstall the C/C++ extension incl. refresh and restart of Visual Studio Code and then newly create of the tasks.json and launch.json files without any includepath.