显示如下:
D:\QTest>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `D:/qtTest'
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runt
ime-pseudo-reloc -Wl,-subsystem,windows -o "debug\qtTest.exe" debug\HelloWorld.o
-L"C:\Qt\4.1.1\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
C:\Qt\4.1.1\lib/libqtmaind.a(qtmain_win.o)(.text+0x30b): In function `WinMain':
C:/Qt/4.1.1/src/winmain/qtmain_win.cpp:105: undefined reference to `qMain(int, c
har**)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\qtTest.exe] Error 1
mingw32-make[1]: Leaving directory `D:/qtTest'
mingw32-make: *** [debug] Error 2
代码:
#include <qapplication.h>
#include <qpushbutton.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
a.setMainWidget( &hello );
hello.show();
return a.exec();
}