一文中找到。
参考网站: http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/
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 -j N
allows to setup number of parallelprocesses for compilation. Number of physical CPU cores is goodchoice forN
.
**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/