Use wmain in CMake for Windows


Windows has special entry point wmain which is fully UNICODE compliant but CMake won’t recognise it out of the box:

int wmain(int argc, wchar_t* argv[], wchar_t* envp[])
	return 0;

might get an error like LNK2019… unresolved external symbol main referenced in function “int __cdecl invoke_main(void)” (?invoke_main@@YAHXZ) …MSVCRTD.lib(exe_main.obj).


Explicitly set program entry point in CMake:


To contact me, send an email anytime or leave a comment below.