按照如下提示安装:
1. Vc2005。任何一款的vc2005编译器都可以,甚至是Express Edition。
2. 下载Qt的OpenSource版本。
http://www.trolltech.com/developer/downloads/qt/windows3. 下载unofficial patch for QT4。
http://sourceforge.net/project/showfiles.php?group_id=49109下载其中的acs4qt42p3.zip
环境变量的设置
将Qt解压缩到D:\QT\4.2.0。设置环境变量QTDIR=D:\qt\4.2.0。
设置QMAKESPEC=win32-msvc2005。下面我用%QTDIR%代表D:\qt\4.2.0
Vc2005装在D:\Program Files\Microsoft Visual Studio 8\
第一步 Apply qt-win patch
将acs4qt42p3.zip解压缩到%QTDIR%, 打开命令行窗口并且移动到%QTDIR%,运行installpatch42.bat。
D:\lib\qt\4.2.0>installpatch42.bat
会看到输出类似如下:
patching file qconfigure.bat
patching file examples/threads/waitconditions/waitconditions.pro
patching file misc/bcc32pch/Makefile.win32-borland
...
检查看是否输出还有错误,如果没有错误,说明patch is applied correctly.
第二步 使用vc2005编译后Qt4
1.运行vsvars32.bat来为vc2005设定环境变量。
D:\lib\qt\4.2.0>"D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
Setting environment for using Microsoft Visual Studio 2005 x86 tools.
2.运行qconfigure.bat来指定vc2005。
D:\lib\qt\4.2.0>qconfigure.bat msvc2005
This is the Qt/Windows Open Source Edition.
You are licensed to use this software under the terms of
the GNU General Public License.
Type '?' to view the GNU General Public License.
Type 'y' to accept this license offer.
Type 'n' to decline this license offer.
Do you accept the terms of the license?
输入y,回车 ,在以后的跳出的问句,均输入y回车。
成功,
后面出现问题:
****************************************************************************************************
Going to compile qmake now
Continue? (Y/N):y
Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
cl -c -FIqmake_pch.h -Yuqmake_pch.h -Fptmp\qmake_pch.pch -nologo -Zm200 -
GS -O1 -MD -DNDEBUG -GR -EHsc -W3 -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -
D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DQT_BUILD_QMAKE -
DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_LIBRARY -DQT_NO_STL -DQT_NO_COMPRESS
-DQT_NO_UNICODETABLES -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -
DQMAKE_OPENSOURCE_EDITION -DQT_NODLL -DQT_NO_THREAD -DQT_NO_QOBJECT -
I"../src/corelib/arch/generic" -I"generators" -I"generators\unix" -
I"generators\win32" -I"generators\mac" -I"../include" -I"../include/QtCore" -
I"../qmake" -I"..\mkspecs\win32-msvc2005" -Fotmp\ @C:\DOCUME~1\ADMINI~1
\LOCALS~1\Temp\nm229.tmp project.cpp
.\project.cpp(42)
: fatal error C1083: Cannot open include file: 'Windows.h': No such file or
directory option.cpp
.\option.cpp
(650) : fatal error C1083: Cannot open include file: 'windows.h': No such file
or directory Generating
Code... NMAKE :
fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 8\VC\BIN\cl.EXE"'
: return code '0x2' Stop.
C:\qt\4.2.0>
****************************************************************************************************
Cannot open include file: 'windows.h': No such file or directory ---》这是怎么回事 ,谢谢指教啊
[ 此贴被XChinux在2007-08-12 22:39重新编辑 ]