Sublime Forum

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 [Finished in 255ms]

#1

Simple Snippet was working fine for me for a month or so but today I clicked some button in the tools section by mistake (I dont know what it was or if the problem is because of it) and it has not been working since then. I deleted and downloaded it again but the same problem still arises.

my code:

#include <iostream>
using namespace std;
int main(){
	freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);

    cout<<"jelo"<<endl;
}

the error:

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
[Finished in 255ms]

but g++ is available in my pc( g++ --version gives me g++ (MinGW.org GCC-6.3.0-1) 6.3.0)

PLEASE HELP

0 Likes