Console-less applications

edited June 2018 in General discussions

Can I confirm that using WinMain is no longer required for compiling a game with no console (as in terminal window), as previously advised here:

And that the correct way is:

A fair bit of documentation mentions the old way and I want to fix that up. I'm pretty sure it was stated in gitter that WInMain is no longer used for anything.


  • I can't find any doc online but that's what I've been witnessing lately with VS2015/VS2017.
    A better investigation is probably needed.

  • No worries, I'll check it out then and confirm.

  • Confirmed on Windows:

    WinMain is no longer required. main is enough.

    For mingw32, add the -mwindows linker flag.
    For Visual Studio, change from Console to Windows.

    Yet to check other OSes. Then I'll document on the wiki.

  • Thanks for checking.
    On Linux and OSX, it works differently, it's not linked to how you build the executable itself.

  • edited June 2018

    Linux just seems to output from whatever terminal you were in at the time. If launched via GUI, no terminal window opens. Just need to check Mac now. Actually I need to check further as I'm sure I've had an extra window open on linux in the past.

Sign In or Register to comment.