Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling a Win32 GUI app (without a console) using MinGW and Eclipse

I'm using the eclipse IDE with MinGW as my compiler, to make a Win32 GUI app.

I want to get rid of the console, but compiling the program with -mwindows option has no effect and the console is still there.

Using the -Wl,--subsystem,windows flag also produces no effect. What am I doing wrong ?

like image 602
viraj Avatar asked Sep 19 '11 16:09

viraj


1 Answers

For gcc on Windows, two things should be considered to build a non-console Windows app:

  1. Compiler option -mwindows
  2. Have WinMain()

It is possible, however, to manually specify -Wl,-subsystem,windows to the linker and include gdi32 and comdlg32 into the build. This is exactly what -mwindows automates.

Reference.

like image 195
Andrejs Cainikovs Avatar answered Sep 28 '22 10:09

Andrejs Cainikovs