2012-09-09 116 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

它适用于我。