I use MinGW to build my application on Windows. When compiling and linking, the -mwindows option is placed on the command line to have Win32 API functions.
More specifically: when invoking GCC from MinGW without "-mwindows", for example:
c:\>g++ -c main.cpp c:\>g++ -o main.exe main.o
"main.exe" after the 2 above commands will work with the console, and the Win32 API functions will not be used.
When invoking GCC from MinGW with "-mwindows":
c:\>g++ -c main.cpp c:\>g++ -o main.exe main.o -mwindows
Now, referring to '-mwindows', 'main.exe' can use the Win32 API, however, it does not start the console when the application starts.
This "-windows" option disables the console, which prevents the printing of debugging information. Any way to save both the console and the '-mwindows' option ?
source share