Why is #include <iostream> not working on VS-code for me?

Viewed 3990

I'm trying to compile a C++ project in Visual Studio Code but I get an error on the #include <iostream> that says: cannot open source file "iostream". The quick fix is to add C:/msys64/mingw64/include/c++/11.2.0 as an include path.

When I try that, I get the error: cannot open source file "bits/c++config.h" (dependency of "iostream"). The quick fix is adding C:/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 as an include path. When I do that, there's no error on the header but there are errors on seemingly random parts of the code.

I've looked up solutions but none of them seem to work.

Here's a screenshot of where the error marks are (ignore that I'm a dirty namespace user)

Here are a few of the error messages:

using: variable "using" is not a type name

std: expected a ';'

cout: identifier "cout" is undefined

c: expression must have integral type

1 Answers
Related