#include <qapplication.h>
#include <qpushbutton.h>
#include <qfont.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton quit( "Quit", 0 );
quit.resize( 75, 30 );
quit.setFont( QFont( "Times", 18, QFont::Bold ) );
QObject::connect( &quit, SIGNAL(clicked()), &a, SLOT(quit()) );
a.setMainWidget( &quit );
quit.show();
return a.exec();
}
qmake -project
qmake
make
g++ -c -pipe -Wall -W -O2 -march=i386 -mcpu=i686 -g -DGLX_GLXEXT_LEGACY -fno-use-cxa-atexit
-fno-exceptions -DQT_NO_DEBUG -I/usr/lib/qt-3.1/mkspecs/default -I. -I. -I/usr/lib/qt-3.1/include -o main.o main.cpp
g++ -o 2 main.o -L/usr/lib/qt-3.1/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
然后就又退回到命令行了,没弹出窗体,怎么回事?
[ 此贴被XChinux在2006-05-31 08:48重新编辑 ]