Console-less applications

edited June 21 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:

http://forum.orx-project.org/discussion/916/a-window-cant-be-killed/p1#Comment_926

And that the correct way is:

http://forum.orx-project.org/discussion/4034/orx-console/p1#Comment_4035

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.

Comments

  • 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 25

    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.