文档章节

How To Compile Qt 4.7 with Visual Studio 2010

Jian-Yong
 Jian-Yong
发布于 2011/09/15 21:05
字数 381
阅读 426
收藏 0

Usual way of installing Qt for Visual Studio is to download already compiled binaries from Nokia website. However binaries for the latest Visual Studio 2010 are not available (on the moment of the writing).

This post is a step-by-step guide on how to compile Qt 4.7.1 with MSVC 2010.

18 July 2011: This guide also works for Qt 4.7.3 and even for Qt 4.8. Just replace version number where applicable.
14 August 2011: In order to build Qt for 64 bits just use Visual Studio x64 Win64 Command Prompt (2010) in step 8. Also install Service Pack 1 for Visual Studio 2010 beforehand – it fixes few bugs related to x64 compilation.

  1. Visual C++ 2010 contains all necessary SDKs for Qt compilation. However if you plan to use Qt with Phonon you need to install additional software from Qt for Windows Requirements list.
  2. Download and extract Qt 4.7.1 Source Code.
  3. Copy contents of the folder qt-everywhere-opensource-src-4.7.1 to the directory where you intend to install Qt. In our case this is C:\Qt\4.7.1.
  4. Set up environmental variables
    QTDIR=C:\Qt\4.7.1
    QMAKESPEC=win32-msvc2010
  5. Update PATH variable to include %QTDIR%\bin
  6. Download the latest version of jom.
  7. Extract jom files to C:\Qt\jom folder
  8. Start Visual Studio 2010 Command Prompt:
    Start > Programs > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio Command Prompt.
  9. Run following commands in it (every line is a different command: type it then press Enter):
    cd c:\Qt\4.7.1
    configure -debug-and-release -opensource -platform win32-msvc2010
    ..\jom\jom.exe -j 4
  10. Download and install Qt Visual Studio Add-in.
  11. Run Visual Studio 2010. Integrate just compiled Qt to IDE using menu Qt > Qt Options > Qt Versions > Add

Usually compilation takes about 10 hours, but thanks to jom and Intel 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. Its parameter -j N allows to setup number of parallel processes for compilation. Number of physical CPU cores is good choice for N.

**Do not forget to use /d switch if you want to change drive in command prompt, e.g: cd /d d:. Usual cd d: does not work anymore – a little “surprise” from Microsoft.

© 著作权归作者所有

Jian-Yong
粉丝 12
博文 93
码字总数 33351
作品 0
郑州
私信 提问
shines77/Disruptor.Net

Disruptor.Net A High Performance Inter-Thread Messaging Library for VS.Net version. VS2010-Net 4.0 For Visual Studio 2010 and use .Net framework 4.0. VS2013-Net 4.5 For Visual S......

shines77
2015/01/14
0
0
Qt配置使用VS2010进行开发

Qt – 一个跨平台应用程序和UI开发框架 它包括跨平台类库、集成开发工具和跨平台 IDE。使用 Qt 您只需一次性开发应用程序,无须重新编写源代码,便可跨不同桌面和嵌入式操作系统部署这些应用...

长平狐
2013/01/06
343
0
Qt Creater error 转换到 COFF 期间失败

版本信息 Qt版本: Qt 5.2.1 MSVC2010 VS版本: visual studio 2010 错误信息 解决方案 我的解决方案: 查找是否有两个cvtres.exe 一个是C:Program Files(x86)Microsoft Visual Studio 10.0v...

NineRec
2014/10/26
641
0
如何在VS2010(VC10)下编译Pro*C OCCI 程序

REF:https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1271017.1&print=Y&bugProductSource= Example compiling an External Procedure using Pro*C Callback ......

老朱教授
2017/11/20
0
0
LinRaise/Log4cplus

% log4cplus README Short Description log4cplus is a simple to use C++ logging API providing thread--safe, flexible, and arbitrarily granular control over log management and conf......

LinRaise
2015/01/22
0
0

没有更多内容

加载失败,请刷新页面

加载更多

Mybatis Plus删除

/** @author beth @data 2019-10-17 00:30 */ @RunWith(SpringRunner.class) @SpringBootTest public class DeleteTest { @Autowired private UserInfoMapper userInfoMapper; /** 根据id删除......

一个yuanbeth
今天
4
0
总结

一、设计模式 简单工厂:一个简单而且比较杂的工厂,可以创建任何对象给你 复杂工厂:先创建一种基础类型的工厂接口,然后各自集成实现这个接口,但是每个工厂都是这个基础类的扩展分类,spr...

BobwithB
今天
5
0
java内存模型

前言 Java作为一种面向对象的,跨平台语言,其对象、内存等一直是比较难的知识点。而且很多概念的名称看起来又那么相似,很多人会傻傻分不清楚。比如本文我们要讨论的JVM内存结构、Java内存模...

ls_cherish
今天
4
0
友元函数强制转换

友元函数强制转换 p522

天王盖地虎626
昨天
5
0
js中实现页面跳转(返回前一页、后一页)

本文转载于:专业的前端网站➸js中实现页面跳转(返回前一页、后一页) 一:JS 重载页面,本地刷新,返回上一页 复制代码代码如下: <a href="javascript:history.go(-1)">返回上一页</a> <a h...

前端老手
昨天
5
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部