for the -tty switch:
windows has console-mode programs and windows PE's.  the windows PE's (GUIs) have WinMain() and the console mode executables have main().

you would need to write your own commandline argument parser for a windows PE, because it just gives you a plain old string instead of char**argv.  I gave up trying to write mine for simpler projects for now.

there are Console series Win32 API functions available at your disposal.  also available are the standard C and C++ libraries.  see to search for any functions that are Console related.

From: Werner LEMBERG <>
Sent: Thursday, February 2, 2012 9:28 PM
Subject: Re: [Mingw-users] Precendence of COM and EXE

> Why not have foo.exe for the console, and foo-win.exe for the GUI?
> Typing "foo" from the console runs foo.exe, while GUI users are more
> likely to use a shortcut (which you create for them, pointing to
> foo-win.exe) or see both .exes in the application's folder and guess
> which is the right one (which they'd have to do anyway given the
> choice of foo.exe or

Yes, I will do that now.  I thought there MUST be a way to be emulate
the convenient Unix way of having a single binary for both GUI and TTY
output (my program has a --tty command line switch), but I now see
that this isn't possible.


Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
MinGW-users mailing list

This list observes the Etiquette found at
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at: