command line compile qt program

1) linux version:
1. create cpp file, ex: test.cpp
  #include <QtGui>
  int main(int argc, char *argv[])
  {
      QApplication app(argc, argv);
      QLabel *label = new QLabel("Linux is wonderful", 0);
      app.setMainWidget(label);   
      label->show();
     return app.exec();
  }
2. use qmake:
qmake -project
 
3. use make
make
 
4. run programe
./test
posted @ 2013-05-23 15:27  Phnix  阅读(316)  评论(0编辑  收藏  举报