Windows下QT的安裝

來源:互聯網
上載者:User

Windows下QT的安裝:

在windows下面,先安裝MinGW,然後安裝QT,安裝過程比較簡單,根據提示可以搞定..

注意:在安裝QT的過程中,會提示選擇MinGW的安裝目錄,也會提示自動設定環境變數(預設會自動設定)

 

-----------------------------------------------------

 

QT下面,第一個程式的運行過程:

 

1、把如下的程式拷貝到檔案“hello.cpp”中:

 

#include <QApplication>

 #include <QLabel>

 int main(int argc, char *argv[])

 {

     QApplication app(argc, argv);

     QLabel *label = new QLabel("Hello Qt!");

     label->show();

     return app.exec();

 }

 

 

2、將檔案“hello.cpp”儲存在目錄“D:\Qt\test\1\hello”下(根據實際情況選擇目錄)

 

3、選擇“Qt 4.1.4 Command Prompt”,進入命令列介面,進入剛才儲存“hello.cpp”的目錄(主要用DOC命令:cd D:\Qt\test\hello )


 

4、在命令提示字元後面,分別輸入:

qmake -project

(to create a platform-independent project file (hello.pro))

qmake hello.pro

(to create a platform-specific makefile from the project file)

make

(to build the program)

 

5、經過以上三個步驟以後,在“hello.cpp”所在的目錄下,得到以下一系列檔案:

 

6、在這個目錄下面的“release”檔案夾下面,得到一個windows下面的可執行程式“hello.exe”:

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.