Dev Gopal Ray
Dev Gopal Ray

Reputation: 1

error in compiling my first code in C++ in VS code editor through mingW

I have authored the following Hello World C++ example...


#include <iostream>

using namespace std;

int main(){

    cout << "Hello World!";

    return 0;
}

...however, I am getting the following error message.
"e:\reality\visual studio\" && g++ first.cpp -o first && "

e:\reality\visual studio\"first

c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):
(.text.startup+0xa0): undefined reference to `WinMain@16'

collect2.exe: error: ld returned 1 exit status

Upvotes: 0

Views: 53

Answers (0)

Related Questions