2014-1-14最新:

????? 第一步:安装VS2010。如果你电脑有VS2010就下一步。

????? 第二步:安装Qt,?下载2个软件:

??????1. 下载Qt5.2.0的windows msvc2010,32位版本:http://www.sxzhongrui.com/official_releases/qt/5.2/5.2.0/qt-windows-opensource-5.2.0-msvc2010_opengl-x86-offline.exe

安装过程一路next,但是在安装位置上要注意就是:如果Qt不允许目录名有空格,所以建议在D/E/F盘下自己新建文件夹Qt。

? ? ? ?还有就是,在浏览-弹出窗口里面新建文件夹好像不可以。解决方法是直接到电脑里面自己动手新建,然后回来选择。

????? 2. 下载VS2010的Qt插件:http://www.sxzhongrui.com/official_releases/vsaddin/qt-vs-addin-1.2.2-opensource.exe

? ? ? 也是一路next, 安装完之后会在vs2010菜单栏上出现Qt5。点击打开QtOption,出现一个窗口,单击切换到Qt Versions,点击Add。

然后点击浏览,转到第一步安装Qt的目录,到目录 D:\Qt\5.2.0\msvc2010_opengl,点击确定即可。(我贴的图是因为已经添加过,所以有红色字体提示。) ? ? ?第三步:测试是否成功。新建项目,如图:

给项目命名, QtApp, 点击确定。如图:

点击下一步,如下图,点击下一步:

类名自己改改,不改应该也没关系。

点击Finish。运行你的项目。弹出一个空白窗口:

说明成功了,开始你的Qt之旅吧。Enjoy yourself!

Qt5.5.0_x64 + vs2010环境

1.安装VS20102.下载qt-5.5.0-x64-msvc2010压缩包3.下载安装连接Qt和VS的一个插件qt-vs-addin.exe(64位32位通用)。4.打开VS2010,配置QT版本

VS2010 + qt5.5.0_64位开发环境,亲测可用

1.安装VS2010

1.VS2010 专业版(中文版本) thunder://QUFlZDJrOi8vfGZpbGV8Y25fdmlzdWFsX3N0dWRpb18yMDEwX3Byb2Zlc3Npb25hbF94ODZfZHZkXzUzMjE0NS5pc298MjU5MTg0NDM1Mnw2MDAxMjUzNDMxQUZFNTczRTQzNDRGNUEwQjFEOUNBQ3wvWlo=

2.VS2010 旗舰版(中文版本)

thunder://QUFlZDJrOi8vfGZpbGV8Y25fdmlzdWFsX3N0dWRpb18yMDEwX3VsdGltYXRlX3g4Nl9kdmRfNTMyMzQ3Lmlzb3wyNjg1OTgyNzIwfDRhZTYyMjg5MzNkZGU0OWQ5YmZhNGMzNDY3YzgzMWMyfFpa

2.下载qt-5.5.0-x64-msvc2010压缩包

链接: https://www.sxzhongrui.com/download/brave_lky/68600682 解压完成之后,配置环境变量 配置QTDIR为bin的上一层路径,如下图

配置Path路径

3.下载安装连接Qt和VS的一个插件qt-vs-addin.exe(64位32位通用)。

连接:https://www.sxzhongrui.com/archive/vsaddin/ 我使用的是 1.12.4版本

4.打开VS2010,配置QT版本

(1)打开Qt Options

(2).点击Add按钮,添加Qt版本

(3).选择和QTDIR路径一致

Qt是诺基亚开发的一个跨平台的C++图形用户界面应用程序框架。它提供给应用程序开发者建立艺术级的图形用户界面所需的所用功能。Qt是完全面向对象的,很容易扩展,并且允许真正地组件编程。本文主要介绍了如何安装Qt4.7.3。具体使用的例子可在

Windows 7 64bit和Visual Studio 2010下安装及使用CGAL 3.8

一文中找到。

参考网站:

http://www.sxzhongrui.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/

?

?

?

1).在

http://www.sxzhongrui.com/qt/source/www.sxzhongrui.com下载Qt 4.7.3源代码包。注意这里我们要手动编译生成所有的库,而不是用安装文件简单安装。整个安装过程耗时在2小时以上。

?

?

?

2).把下载到的

qt-everywhere-opensource-src-4.7.1压缩包解压的制定文件夹。注意,路径中不要包含空格等特殊字符!如C:\Qt\4.7.3

?

?

?

3).在我的电脑中设置环境变量

?

?

?

?

?

?

?

QTDIR=C:\Qt\4.7.3

?

?

?

?

?

?

?

QMAKESPEC=win32-msvc2010

?

?

?

?

?

?

?

然后在Path中添加%QTDIR%\bin

?

?

?

4).在

ftp://www.sxzhongrui.com/jom/下载最新版本的jom,这里笔者下载了jom106。把jom放到和Qt根目录平级的地方。如C:\Qt\jom

?

?

?

5).打开VS2010的命令行窗口,进入C:\Qt\4.7.3文件夹。输入

?

?

?

?

?

?

?

configure -debug-and-release -opensource -platform win32-msvc2010

?

?

?

?

?

?

?

大概十分钟以内可以完成。注意,如果要编译32位库,就用普通的Visual Studio CommandPrompt。如果要编译64位库,就使用Visual Studio x64 Win64 Command Prompt。

?

?

?

6).这一步耗时非常长。在我的电脑上用了1个多小时。

?

?

?

?

?

?

?

在命令行窗口输入

?

?

?

?

?

?

?

..\jom\jom.exe -j 4

?

?

?

7).经过漫长的等待,我们成功的安装了Qt 4.7.3。

?

?

?

8).使用例子可见

Windows 7 64bit和Visual Studio 2010下安装及使用CGAL3.8一文。

国外博客原文

How To Compile Qt 4.7 with Visual Studio 2010

February 1,2011

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 folderqt-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-msvc2010Update PATH variable to include%QTDIR%\binDownload the latest version of jom.Extract jom files to C:\Qt\jom folderStart Visual Studio 2010 Command Prompt: Start > Programs > MicrosoftVisual Studio 2010 > Visual Studio Tools> Visual Studio Command www.sxzhongrui.com following commands in it: cd c:\Qt\4.7.1 configure -debug-and-release -opensource -platform win32-msvc2010 ..\jom\jom.exe -j 4Download and install Qt VisualStudio www.sxzhongrui.com 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://www.sxzhongrui.com/s/blog_6e0693f70100tzvz.html

http://www.sxzhongrui.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/