The error tells you you're missing either a
main
function or WinMain
. Either one will work, regardless of -mconsole
/-mwindows
. -mconsole
is already the default, you don't need it. And -Wl,-e,mainCRTStartup
is also unnecessary.