Cannot print Hello World statement in Visual Studio Code

Viewed 50

So I am really new when it comes to C++, and have tried learning it. So far I have installed the MINGW64 MYSYS2 thing for the gcc, gdb and g++ (compilers?). And have created my workspace.

Whenever I try to print the "Hello World" statement, it won't print it for some reason? I really have no idea what I am doing wrong. Can someone please help.

Code:

#include <iostream>

int main() {
    std::cout << "Hello World";
    return 0;   
}

Output:

 *  Executing task: C/C++: g++.exe build active file 

Starting build...
"C:\Program Files\Haskell Platform\8.6.5\mingw\bin\g++.exe" -fdiagnostics-color=always -g "C:\Users\bsdwi\Documents\Visual Studio 2017\C C++\HelloWorld\HelloWorld.cpp" -o "C:\Users\bsdwi\Documents\Visual Studio 2017\C C++\HelloWorld\HelloWorld.exe"

Build finished successfully.
 *  Terminal will be reused by tasks, press any key to close it. 

Followed by this pop-up message: error message

Has it got something to do with the Haskell thing? I am so new to Visual Studio Code and C++ so I'd really appreciate any help. And apologies in advance if I have missed something out that you guys need in order to help me. Please let me know if you require more information.

0 Answers
Related