Qt是诺基亚开发的一个跨平台的C++图形用户界面应用程序框架。它提供给应用程序开发者建立艺术级的图形用户界面所需的所用功能。Qt是完全面向对象的,很容易扩展,并且允许真正地组件编程。本文主要介绍了如何安装Qt4.7.3。具体使用的例子可在Windows 7 64bit和Visual Studio 2010下安装及使用CGAL 3.8
一文中找到。
参考网站:http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/
4.7.3源代码包。注意这里我们要手动编译生成所有的库,而不是用安装文件简单安装。整个安装过程耗时在2小时以上。
qt-everywhere-opensource-src-4.7.1压缩包
解压的制定文件夹。注意,路径中不要包含空格等特殊字符!如C:\Qt\4.7.3
国外博客原文
How To Compile Qt 4.7 with Visual Studio 2010
Usual way of installing Qt for Visual Studio is to downloadalready compiled binaries from Nokia website. However binaries forthe latest Visual Studio 2010 are not available (on the moment ofthe writing).
This post is a step-by-step guide on how to compile Qt 4.7.1with MSVC 2010.
18 July 2011: This guide also works forQt 4.7.3 and even forQt 4.8.Just replace version number where applicable.
- Visual C++ 2010 contains all necessary SDKs for Qt compilation.However if you plan to use Qt with Phonon you need to installadditional software fromQt forWindows Requirements list.
- Download and extract
Qt 4.7.1 Source Code. - Copy contents of the folder
qt-everywhere-opensource-src-4.7.1
to the directorywhere you intend to install Qt. In our case this isC:\Qt\4.7.1
. - Set up environmental variables
QTDIR=C:\Qt\4.7.1
QMAKESPEC=win32-msvc2010 - Update
PATH
variable to include%QTDIR%\bin
- Download the latest version of jom.
- Extract jom files to
C:\Qt\jom
folder - Start Visual Studio 2010 Command Prompt:
Start > Programs > MicrosoftVisual Studio 2010 > Visual Studio Tools> Visual Studio Command Prompt
. - Run following commands in it:
cd c:\Qt\4.7.1
configure -debug-and-release -opensource -platform win32-msvc2010
..\jom\jom.exe -j 4 - Download and install
Qt VisualStudio Add-in. - Run Visual Studio 2010. Integrate just compiled Qt to IDE usingmenu
Qt > Qt Options
Usually compilation takes about 10 hours, but thanks to jom andIntel SSD drive it took only 2 hours 40 minutes on my machine(Windows 7, 64bits)
Remarks.
*Jom is nmake replacement for Qt compilation on multi-core CPU. Itsparameter
allows to setup number of parallelprocesses for compilation. Number of physical CPU cores is goodchoice for
-j NN
.
**Do not forget to use /d
switch if you want tochange drive in command prompt, e.g:cd /d d:
. Usualcd d:
does not work anymore – a little “surprise” fromMicrosoft.
参考链接:
http://blog.sina.com.cn/s/blog_6e0693f70100tzvz.html
http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/