Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 98725

The ever-popular vscode #include iostream error

$
0
0

I've uninstalled and reinstalled mingw-64 and vscode, following the instructions at https://code.visualstudio.com/docs/cpp/config-mingw. I've set the include path and the compiler path. I look in the directory where all the header files are located, and, sure enough, iostream is in there.

This time I didn't get the squiggle line under #incluide the way I had before, when I typed in the helloworld program. Great! I thought, it's fixed. I compiled the program. The result?

helloworld.cpp:1:10: fatal error: iostream: No such file or directory
 #include <iostream>
          ^~~~~~~~~~
compilation terminated.
The terminal process terminated with exit code: 1

Here's the path: C:\MinGW_w64\mingw32\lib\gcc\i686-w64-mingw32\8.1.0\include\c++ Here's the compiler path: C:/MinGW_w64/mingw32/bin/g++.exe"

And, what the heck, here's the code:

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{

    vector<string> msg {"Hello", "C++", "World", "from", "VS Code!"};

    for (const string& word : msg)
    {
        cout << word << "";
    }
    cout << endl;
}

Viewing all articles
Browse latest Browse all 98725

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>