2012-09-09 110 views
1

我做了以下運行簡單Qt程序:運行一個簡單的Qt程序

  • 創建一個hello文件夾
  • 創建一個hello.cpp程序如下:
#include <QApplication> 
    #include <QLabel> 

    int main(int argc, char* argv[]) 
    { 
    QApplication app(argc, argv); 
    QLabel *label = new QLabel("Hello..."); 
    label->show(); 
    return app.exec(); 
    } 
  • qmake -project
  • qmake hello.pro --->在這裏我得到Makefile
  • 冉「使」,在這裏,我得到這樣的事情,並且似乎還在繼續訴訟,除非我停下來:

c:\ QtSDK \ Desktop \ Qt \ 4.8.1 \ msvc2008 \ bin \ qmake.exe c:\ Users \ Ola \ Desktop \ hello \ hell o.pro -o Makefile.hello make -f Makefile.hello make [1]:進入目錄/c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello make -f Makefile.hello.hello make[2]: Entering directory/c/Users/Ola/Desktop/hello' c:\ QtSDK \ Desktop \ Qt \ 4.8.1 \ msvc2008 \ bin \ qmake.exe c:\ Users \ Ola \ Desktop \ hello \ hell o.pro -o Makefile.hello.hello.hello make -f Makefile.hello.hello.hello make [3]:進入目錄/c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello.hello.hello make -f Makefile.hello.hello.hello.hello make[4]: Entering directory/c/Users/Ola/Desktop/hello' c:\ QtSDK \ Desktop \ Qt \ 4.8.1 \ msvc2008 \ bin \ qmake.exe c: \ Users \ Ola \ Desktop \ hello \ hell o.pro -o Makefile.hello.hello.hello.hello.hello make -f Makefile.hello.hello.hello.hello.hello make [5]:進入目錄/c/Users/Ola/Desktop/hello' c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake.exe c:\Users\Ola\Desktop\hello\hell o.pro -o Makefile.hello.hello.hello.hello.hello.hello make -f Makefile.hello.hello.hello.hello.hello.hello make[6]: Entering directory/c/Users/Ola/Desktop/hello' c:\ QtSDK \ Desktop \ Qt \ 4.8.1 \ msvc2008 \ bin \ qmake.exe c:\ Users \ Ola \ Desktop \ hello \ hell o.pro - Makefile.hello.hello.hello.hello.hello.hello.hello make -f Makefile.hello.h ello.hello.hello.hello.hello.hello 化妝[6]:* [子你好-PRO-make_default]中斷 使[5]:* [子你好-PRO-make_default]中斷 化妝[ 4]:* [sub-hello-pro-make_default]中斷 make [3]:* [sub-hello-pro-make_default]中斷 make [2]:* [sub-hello-pro-make_default]中斷 化妝[1]:* [子你好,親make_default]中斷 化妝:* [子你好,親make_default]中斷

我該如何運行程序?

謝謝。

+0

請問,你能顯示你的.pro文件嗎? –

+0

@ Luca Carlon。它沒有生成!我不知道爲什麼?! – Simplicity

+0

哪個windows版本? –

回答

3

使用與Qt安裝包一起安裝的Qt命令提示符。然後,而不是使用make,使用mingw32-make

它適用於我。