undefined reference to `WinMain‘collect2.exe: error: ld returned 1 exit status

created at 08-20-2021 views: 49

I met this C++ error, although others may not encounter it, but I still want to record the mistakes I made

The cause of the problem is as follows

int mian()
{
   time_t now = time(0);
   cout << now << endl;
   return 0;
}

A few lines of code were reported wrong, and at the last glance, it turns out that main was wrong and written as mian.

Modify it and it will not report an error.

created at:08-20-2021
edited at: 08-20-2021: