I was trying to use wmain
for simple test code to practice with WCS strings (not MBCS), but I'm consistently getting error, while can't find out why.
Here is my code.
#include <iostream>
#include <stdio.h>
using namespace std;
int wmain(int argc, wchar_t * argv[])
{
for (int i = 1; i < argc; i++) {
fputws(argv[i], stdout);
fputws(L"\n", stdout);
}
return 0;
}
And it gives the error message.
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
Why does it crash? I cannot find out why this error comes up.