在没有官方支持的情况下,如何使用Visual Studio 2015构建Qt 4.8.6? [英] How to build Qt 4.8.6 with Visual Studio 2015 without official support?

查看:246
本文介绍了在没有官方支持的情况下,如何使用Visual Studio 2015构建Qt 4.8.6?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前(2015年9月)没有针对Visual Studio 2015的正式Qt构建.如何手动构建?

解决方案

可以很容易地手动构建.以下示例适用于Qt 4.8.6.

  1. 下载Qt 4.8.6来源: http://download .qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.zip 然后打开包装.假设Qt前缀为c:\ Qt-2015 \ 4.8.6 \ msvc2015.将下载的源目录中的源复制到{prefix dir}.

  2. 应用补丁02-fix_build_with_msvc2015-45e8f4ee.diff https://drive.google.com/file/d/0Bz6Oefew6XZnOU9ac0hIeG41UVE/view ?usp =分享 参见帖子: https://forum.qt.io/topic/56453/compiling-qt4-head-with-msvc-2015-cstdint-errors/5 摆脱编译错误 (我手动应用了所有更改,时间不长).

  3. 在mkspecs目录中制作新的win32-msvc2015规范: 创建win32-msvc2015目录,复制win32-msvc2013 dir的内容, 编辑qmake.conf:将_MSC_VER设置为1900,并在适当的情况下将2013年到2015年的所有文本更新:

  4. 在{prefix dir}/qmake/目录中编辑makefile.win32文件: 找到所有win32-msvc2013事件并类似地添加win32-msvc2015:

  5. 现在从Visual Studio 2015命令提示符

    运行(这些是示例命令,其他命令可能会因构建需求而有所不同):

    configure -make nmake -platform win32-msvc2015 -prefix c:\Qt-2015\4.8.6\msvc2015 -opensource -confirm-license -opengl desktop -nomake examples -nomake tests

    选项-make nmake 之所以需要,是因为configure.exe默认情况下会搜索nmake的最高版本与2013年的版本,否则它将使用make.

  6. 然后执行单核构建命令

    nmake

    (或jom.exe -jN,其中N <= CPU内核数).

    仅此而已.此示例没有Webkit,示例和演示-为了提高速度. 对我来说,在单核上构建大约需要1.5个小时.

At this time (September 2015) there is no official Qt build for Visual Studio 2015. How to build it manually?

解决方案

It can be built manually quite easily. The example below is for Qt 4.8.6.

  1. Download Qt 4.8.6 sources: http://download.qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.zip and unpack. Let the Qt prefix be c:\Qt-2015\4.8.6\msvc2015. Copy sources inside the downloaded source dir to {prefix dir}.

  2. Apply the patch 02-fix_build_with_msvc2015-45e8f4ee.diff https://drive.google.com/file/d/0Bz6Oefew6XZnOU9ac0hIeG41UVE/view?usp=sharing see post: https://forum.qt.io/topic/56453/compiling-qt4-head-with-msvc-2015-cstdint-errors/5 to get rid of compilation errors (I applied all changes by hand, it's not so long).

  3. Make new win32-msvc2015 spec in mkspecs directory: create win32-msvc2015 directory, copy the contents of win32-msvc2013 dir, edit qmake.conf: set _MSC_VER to 1900 and update all text from 2013 to 2015 where appropriate:

  4. Edit makefile.win32 file in {prefix dir}/qmake/ directory: find all win32-msvc2013 occurences and add win32-msvc2015 similarly:

  5. Now from the Visual Studio 2015 command prompt

    run (these are the example commands, additional commands may be different depending on the build needs):

    configure -make nmake -platform win32-msvc2015 -prefix c:\Qt-2015\4.8.6\msvc2015 -opensource -confirm-license -opengl desktop -nomake examples -nomake tests

    Option -make nmake is need because configure.exe searches max version vs 2013 of nmake by default, otherwise it uses make.

  6. Then for single core build command

    nmake

    (or jom.exe -jN, where N <= number of CPU cores).

    That's all. This example is without Webkit, examples and demos - for speed. For me it takes ~1.5 hours to build on the single core.

这篇关于在没有官方支持的情况下,如何使用Visual Studio 2015构建Qt 4.8.6?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆