When I compile and run a simple Win32 GUI program in MinGW+MSys with command line:
$ g++ main.cpp -o app -std=c++0x
$ ./app
only a dialog box shows. But when I put this program into Code::Blocks IDE and compile it, it always results in a black console box with the dialog. Adding -mwindows
in link options no effect.
main.cpp:
#include <windows.h>
int WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
MessageBox(0,"Hello, Windows","MinGW Test Program",MB_OK);
return 0;
}
How can I get rid of the console box?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…