轉載地址:http://zxdflyer.blog.163.com/blog/static/2566426220127317484980/windows
(Please note that there are only 32-bit binary builds of Qt available from TrollTech. Because of this, in order to run Qt in 64-bit, Qt must be manually built on windows in both 32-bit and 64-bit binary builds.Qt官方網站上只發布了32位Qt庫,所以若是要運行64位Qt庫的話,須要本身在windows系統下編譯64位Qt庫)
原文中介紹了32位和64位Qt的編譯方法。32位編譯方法網上資料不少,這裏再也不贅述,32位Qt庫也能夠直接從Qt官方網站下載(如qt-win-opensource-4.7.0-vs2008,安裝後便可使用),免去了編譯Qt的時間。下面是編譯64位版本的步驟:
一、 First extract the Qt zip file to a directory on your system.首先解壓Qt開源文件到64位系統中(win7-X64)。確保X64位編譯器已經安裝,X64編譯器安裝參考前篇日誌。我機器中解壓目錄爲:H:\QT-X64\qt-everywhere-opensource-src-4.7.1。
二、To make the 64-bit build of Qt, go to Visual Studio 2008->Visual Studio tools in the start menu and click on:Visual Studio 2008 x64 Win64 Command Prompt. 從程序目錄中選擇Visual Studio 2008->Visual Studio tools->Visual Studio 2008 x64 Win64 Command Prompt,點擊打開。
三、In the Command Prompt, go to the 64-bit Qt directory you just extracted.在命令提示行中,定位到你的Qt源文件目錄:如cd H:\QT-X64\qt-everywhere-opensource-src-4.7.1。
四、 Once you in the directory, type(定位到Qt目錄後,鍵入以下命令):
configure.exe -qt-gif -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg
This will generate a Makefile. 配置完成後,會生成相應的Makefile文件。
五、Now to start the compilation, run nmake by typing: nmake.
配置完成後,輸入nmake命令啓動編譯。編譯時間較長,耐心等待。
六、Once the compilation is complete, then type: nmake install
編譯完成後,鍵入「nmake install」命令完成Qt安裝。安裝完成後,會獲得Qt相應的包含目錄(頭文件),dll、lib庫文件,這是咱們最終須要的。網站