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/

最新文章

  1. js浮点乘除法运算不精确bug
  2. SQL Server中截取字符串常用函数
  3. LR检查点的if (status == LR_FAIL)写法
  4. windows 64位 dll文件 位置及python包rtree shapely安装
  5. ORA-32004 参数设置过时的解决办法
  6. Spring 4.2 annotation event Publisher/Listener
  7. table隔行换色
  8. C++中弱符号(弱引用)的意义及实例
  9. android 自定义命名空间
  10. poj 2749 Building roads (二分+拆点+2-sat)
  11. Banner 切换
  12. MEF 基础简介 三
  13. Java集合类源码解析:AbstractList
  14. ABP拦截器之UnitOfWorkRegistrar(一)
  15. HISI VENC 实际输出帧率控制
  16. EasyUI ComboGrid 笔记(支持分页)
  17. C#设计模式(8)——外观模式
  18. 905. Sort Array By Parity
  19. 【转】我为什么离开 Cornell
  20. POJ 2312:Battle City(BFS)

热门文章

  1. struts2框架的核心内容
  2. iwebshop 改版页面
  3. JavaScript Infinite scroll &amp; Masonry
  4. Python学习笔记(五)Python的切片和迭代
  5. MS SQL 小总结
  6. gdal读写图像分块处理(精华版)
  7. javascript事件设计模式
  8. Java报表开发组件DynamicReports
  9. poj 1742 coins_多重背包
  10. 【csdn】文章很好 - system函数遇到的问题