undefined reference to `[email protected]′ collect2.exe: error: ld returned 1 exit status beginner [duplicate]

  c++

I have just began learning C++ language (as u can see).when i run this code

#include<iostream>
using namespace std;

int MAIN(){

    cout<<"hello worldn";
    return 0;

}

I get this error,

c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to `[email protected]'
collect2.exe: error: ld returned 1 exit status

I have installed mingw mingw32-base-bin and mingw32-gcc-c++-bin

Source: Windows Questions C++

LEAVE A COMMENT