使用MinGW和Eclipse编译Win32 GUI应用程序(无控制台) [英] Compiling a Win32 GUI app (without a console) using MinGW and Eclipse
问题描述
我想摆脱控制台,但使用 -mwindows
选项编译程序没有任何效果,控制台仍然存在。
使用 -Wl, - 子系统,windows
标志也不产生影响。我在做错什么?
对于Windows上的gcc,应该考虑建立一个非控制台Windows应用程序的两件事情:
- 编译器选项
-mwindows
- 有
WinMain()
然而,可以手动指定 -Wl,-subsystem,windows
到链接器,并包含 gdi32
和 comdlg32
进入构建。这就是 -mwindows
自动化。
参考。
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 ?
For gcc on Windows, two things should be considered to build a non-console Windows app:
- Compiler option
-mwindows
- 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.
这篇关于使用MinGW和Eclipse编译Win32 GUI应用程序(无控制台)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!