开发者

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

I'm us开发者_开发百科ing 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 ?


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.


try --machine-windows option. it helps me when I build asm code:

nasm -f win64 hello.asm
gcc hello.obj --machine-windows -o hello
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜