currently I am trying to make a windows application using c++. For compiling my program I use Mingw GCC. Btw I\'m on Windows 10.
But as soon as I use int WINAPI wWinMa
The solution is to add -municode
to the compilation parameters, as mentioned by @ssbssa in a comment.
Example:
g++ helloworld3.cpp -o helloworld3 -Wl,-subsystem,windows -municode
See https://sourceforge.net/p/mingw-w64/wiki2/Unicode%20apps/
While it is not necessary to define _UNICODE or UNICODE to compile the above code, -municode is needed for linking because it uses wmain() instead of the traditional main().