I usually avoid writing articles about building a specific version of a software project but this time I need to archive it for later use and I believe it’s useful to my fellow programmers.

Despite it’s been released for a while already, it seems the Qt project won’t release binaries prebuilt with Visual Studio 2015 until Qt 5.6 is out. That is to say, somewhere between today and say January, 2016 (blind guess). At work, we’re transitioning from Visual Studio 2012 to Visual Studio 2015 and some projects depend on Qt. That’s why I decided to bite the bullet.

I have to say that I found Qt’s official building from source instructions rather vague. Let the treasure hunt begin.

I first stumbled upon the Qt for Windows - Building from Source page which itself links to the Qt for Windows - Requirements page. The requirements page mentions the ICU and ANGLE libraries. ICU is needed when building QtWekbit and ANGLE is what Qt uses by default for its official Windows builds. To build ANGLE, the requirements page implies you have to install the Direct X SDK. Don’t panic if you don’t find the download for that SDK: it’s been a long time since that SDK ships as part of the Windows SDK itself, which you install along with Visual Studio 2015.

At that point, I felt alone but that didn’t last long. I joined #qt on Freenode and asked around. Someone mentioned theBuilding Qt 5 from Git page on Qt’s wiki which indirectly points to the Compiling ICU with MSVC page.

I decided to go with ICU4C version 54.1 as instructed in the wiki page. However, this version needs to be patched in order to build with Visual Studio 2015: I opened source/io/ufile.c at line 66 and replaced:

#if U_PLATFORM_USES_ONLY_WIN32_API

by

#if U_PLATFORM_USES_ONLY_WIN32_API && _MSC_VER < 1900

Then, I proceeded with building ICU as explained in Qt’s wiki.

As for ANGLE, it turns out Qt bundles its own version and there’s nothing to do. Qt’s configure script will just detect and use it.

QtWebkit now. The Building Qt 5 from Git page tricks you into visiting the official Build Instructions for the QtWebKit build on Windows page on Webkit’s wiki. Just don’t go there. It’s just adding more confusion. You don’t have to build QtWebkit yourself, it’s going to be built as part of Qt’s build provided you installed the proper prerequisites.

Before proceeding with building Qt (with QtWebkit), all you need is to do is installing the following tools (listed on theBuilding Qt 5 from Git page):

Those tools have to be in your %PATH% environment variable as well as Qt’s gnuwin32\bin directory which providesbisonflex and gperf.

I decided to install Active Python 2.7, Strawberry Perl 5.22.0.1 (64 bit) and RubyInstaller 2.2.3 (x64).

Finally, Qt 5.5.1’s source drop shipped with a bug that despite having been opened against RC1 was resolved as “works on our machines, SHIP IT!” :D Hopefully, resolution is quite easy, I just patched src/3rdparty/assimp/assimp.pri.

After all those steps, I successfully built Qt 5.5.1 with QtWebkit with Visual Studio 2015. To help you out, I prepared two Windows batch files: build-x64.bat and build-x86.bat. Create a directory somewhere on your computer and make sure you come up with the following directory structure:

.
├── build-x64.bat
├── build-x86.bat
├── icu
│   └── source
│   ├── ...
│   └── configure
└── qt-everywhere-opensource-src-5.5.1
   ├── ...
└── configure

Finally, open a CMD.exe prompt, cd to the directory containing the .bat files and launch either build-x64.bat orbuild-x86.bat

Hope that helps!

http://files.cnblogs.com/files/findumars/qt5.51_webkit_build.rar

http://pempek.net/articles/2015/10/18/compiling-qt-5-5-1-with-visual-studio-2015/

Compiling Qt 5.5.1 (With Qtwebkit) With Visual Studio 2015的更多相关文章

  1. Visual Studio 2015编译安装配置QT5.5.1(含QTWEBKIT)

    尽管QT5.5.1和VisualStudio 2015都已经发布很久了,但是QT项目组视乎不会为QT5.5.1专门发布预编译的QT5.5.1 for windows(2015)版本的,也不会专门发布V ...

  2. Visual Studio 2015开发Qt项目实战经验分享(附项目示例源码)

    Visual Studio 2015开发Qt项目实战经验分享(附项目示例源码)    转 https://blog.csdn.net/lhl1124281072/article/details/800 ...

  3. Setup QT 5.5.1 + OpenCV 3.0 + Visual Studio 2013 on windows 10

    1. Install Visual studio 2013 community version which is free to use for personal usage. 2. Setup th ...

  4. 使用 Visual Studio 2015 编译 QT 工程

    简单进行一下几步就可以了 1.下载源代码 qt-everywhere-opensource-src-5.6.0-alpha.7z .解压到 D:\ToolKits\5.6.0\src 目录下2.网站 ...

  5. Visual Studio + Qt开发环境搭建

    1. 安装Visual Studio 2015 Visual Studio 2015下载地址如下,安装比较常规,不做介绍. Visual Studio Enterprise 2015 with Upd ...

  6. Qt Visual Studio Add-in 导出的 .pri 怎么用?

    今天咱们介绍一下 Qt Add-in 导出的 pri 文件怎么用.   一般需要导出这个文件, 主要应该是跨平台编译的需求, 所以这个文件里包含的东西会比较少, 咱们看下导出的文件是什么样子的: # ...

  7. Qt环境搭建(Qt Creator)+Visual Studio

    1.http://www.cnblogs.com/ranjiewen/p/5318768.html 简述 经常有人问我编写Qt程序时使用什么IDE,其实这个真的很难回答(各有所长),只能说看个人爱好了 ...

  8. qt 4.6.2 与visual studio 2005 集成(编译方法,以及中间遇到的问题)

    不知不觉在蒂森差不多半个月了,哈哈,时间过得很快,过得很充实,近来研究QT,首先嘛,肯定要学会安装了,这最基础的不会更不用说下面的啦.闲话少说,进正题,基本的安装步骤网上多的是,但参考一个大多数情况是 ...

  9. Qt环境搭建(Visual Studio)

    简述 经常有人问我编写Qt程序时使用什么IDE,其实这个真的很难回答(各有所长),只能说看个人爱好了,因为我两个都用,而且两个都很喜欢(比较多情吧O(∩_∩)O~)! 下面将进行Qt Creator与 ...

随机推荐

  1. PHP基础温习之echo print printf sprintf print_r var_dump的用法与区别

    一.echoecho() 实际上不是一个函数,是php语句,因此您无需对其使用括号.不过,如果您希望向 echo() 传递一个以上的参数,那么使用括号会发生解析错误.而且echo是返回void的,并不 ...

  2. 你与优秀源码之间只差一个 Star

    fir.im Weekly - 你与优秀源码之间只差一个 Star   说起开源社区,Github 是一个不可缺少的存在.作为全球最大的同性交友网站,上面有太多优秀的开源代码库和编程大神,让无数开发者 ...

  3. 关于网络协议和socket编程基本概念

    TCP协议可以说已经是IT人耳熟能详的协议,最近在学习socket网络编程时后重新温习一下这个协议,针对一些问题做了一些总结,很多理解可能还不是很准确. 1. 协议是什么?所谓的各种网络协议无非是一种 ...

  4. win7系统怎样备份

    利用系统自带的备份还原 1 这种方法的缺点是如果以后系统出现问题,无法进入系统的话,就无法恢复系统了.首先我们点击开始菜单,打开控制面板! 2 在控制面板中点击系统和安全! 3 我们选择备份和还原中的 ...

  5. 商人过河问题(二)java实现

    本文实现的java版商人过河是参考http://wenku.baidu.com/link?url=dpe2AC8mCjpGnclFv6iZy88_vqYm3bED4QDpSkAI4ssgs7Bhntu ...

  6. 【Android Training UI】创建自定义Views(Lesson 0 - 章节概览)

    发表在我的独立网站http://kesenhoo.github.io/blog/2013/06/30/android-training-ui-creating-custom-views-lesson- ...

  7. Python学习入门基础教程(learning Python)--8.1 字典数据添加与删除

             1. 字典数据添加 这个很简单,像赋值那样一项项赋值即可.语法结构如下 dict_obj[key] = value 添加数据项示例如下 >>> d1 = {'cod ...

  8. Java反射及依赖注入简单模拟

    一.编写Dao类 ? 1 2 3 4 5 6 7 8 9 10 11 package cn.com.songjy.annotation;   import java.util.Date;   publ ...

  9. animate CSS动画程序接口(仅Chrome可用)

    jQuery中很早就提供了animate方法,使用它可以很方便地实现一些简单动画效果.后来CSS3中也提供了animation用于动画效果制作,但CSS本身的可操作性太差,所以用起来并不方便.现在最新 ...

  10. web中通过注释判断浏览器<!--[if !IE]><!--[if IE]><!--[if lt IE 6]><!--[if gte IE 6]>版本

    <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]--><!--[if IE]> 所有的IE可识别 <![e ...