0

I don't know why I got red underline on #include <iostream>. I use VSCode for IDE and C/C++ has installed. My code is very basic but I don't know why it still have red underline.

My code :

#include <iostream>    //This line got red underline.
using namespace std;

int main() {
    cout << "Hello";
    retern 0;
}

While it run.

[Running] cd "c:\Users\hola\Desktop" && g++ testplusplus.cpp -o testplusplus && "c:\Users\hola\Desktop"testplusplus 'g++' is not recognized as an internal or external command, operable program or batch file.

[Done] exited with code=1 in 0.05 seconds

Schwann
  • 3
  • 1
  • 4

1 Answers1

2
'g++' is not recognized as an internal or external command, operable program or batch file.

This is because the g++ compiler is not installed (and/or not added to the PATH environment variable, this will probably help you). MinGW is the GCC (GNU Compiler Collection) adaptation for Windows, and thus should be used.

Concerning the preprocessor directive #include <iostream> there are some rare occasions where IDEs and underlying compile-time processes return a false-positive (It could happen on any line in the file).

R. Théo
  • 74
  • 1
  • 7