gpt4 book ai didi

visual-studio - 如何在没有官方支持的情况下使用 Visual Studio 2015 构建 Qt 4.8.6?

转载 作者:行者123 更新时间:2023-12-03 03:36:01 24 4
gpt4 key购买 nike

目前(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=sharing参见帖子:https://forum.qt.io/topic/56453/compiling-qt4-head-with-msvc-2015-cstdint-errors/5消除编译错误(我手动应用了所有更改,并没有那么长)。

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

    enter image description here

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

    enter image description here

    enter image description here

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

    enter image description here

    运行(这些是示例命令,其他命令可能会有所不同,具体取决于构建需求):

    configure -make nmake -platform win32-msvc2015 -prefix c:\Qt-2015\4.8.6\msvc2015 -opensource -confirm-license -opengl Desktop -nomake Examples -nomake测试

    选项-make nmake之所以需要,是因为configure.exe默认搜索nmake的最大版本vs 2013,否则它使用make。

  6. 然后是单核构建命令

    nmake

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

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

关于visual-studio - 如何在没有官方支持的情况下使用 Visual Studio 2015 构建 Qt 4.8.6?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32848962/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com