Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

#include errors detected. Please update your includePath in visual studio code

I'm trying to compile C++ files in Visual Studio Code How to use C/Cpp extension and add includepath to configurations but I'm getting this errors:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit.
cannot open source file "iostream"

I already saw this question and any of the solutions worked for me. Also I recorded a video following the steps of the visual studio code tutorial. Here is my code:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello World" << endl;
}

And this are my C/C++ settings:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\x86_64-w64-mingw32\\include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gcc.exe",
            "cStandard": "gnu17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "${default}"
        }
    ],
    "version": 4
}
like image 431
Andres Medina Avatar asked Aug 27 '26 16:08

Andres Medina


1 Answers

open command pallete (ctrl + shift + P) then search edit configuration , select C/C++ edit configuration(UI) . Then scroll down and you will see include path , copy the location of your include path by finding it in file manager , By default the location would be C:\Program Files(x86)\mingw-w64\......\mingw32\include. Set intellisense to default. Now you are ready to enjoy your coding journey.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!