win7系统下64位Qt的编译

转载地址:http://zxdflyer.blog.163.com/blog/static/2566426220127317484980/

(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位版本的步骤:


1、 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。


2、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,点击打开。


3、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。


4、 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文件。


5、Now to start the compilation, run nmake by typing: nmake.


     配置完成后,输入nmake命令启动编译。编译时间较长,耐心等待。


6、Once the compilation is complete, then type: nmake install


     编译完成后,键入“nmake install”命令完成Qt安装。安装完成后,会得到Qt相应的包含目录(头文件),dll、lib库文件,这是我们最终需要的。

posted @ 2018-08-02 14:36  浪潮之巔  阅读(3577)  评论(2编辑  收藏  举报