gpt4 book ai didi

qt - 在 msvc2017 上构建 Qt 5.12.4 的 qtwebengine 以启用专有编解码器

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

我想在 Windows 10 上构建 Qt 5.12.4,以便让 qtwebengine 具有适用于 x86 应用程序的专有编解码器,但我得到了 64-bit cross-building or native toolchain is required运行 qmake .\qtwebengine -- -webengine-proprietary-codecs 报错如下命令。

qmake webengine with proprietary codecs
在运行 qmake 命令之前,我执行以下步骤:

  • 以管理员身份运行 Windows 命令提示符。将目录更改为
  • C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build
    并运行以下脚本:

    vcvarsall.bat amd64_x86



    我运行这个命令是因为 我想为 x86 应用程序构建 Qt WebEngine。
  • 将目录更改为
  • D:\Qt\Qt5.12.4\5.12.4\Src
    并运行以下命令:

    configure -webengine-proprietary-codecs



    在这个配置设置之后,我得到了这个结果:
    enter image description here

    我安装了这些 Qt webengine 编译先决条件:

    -Python 2.7.15

    -野牛,Flex 来自 here

    -GPerf(32 位)来自 here

    -ActivePerl(64 位)来自 here

    -LLVM(64 位)来自 here

    -Visual Studio 2017

    -Windows 10 SDK

    我还将它们添加到 Windows 路径并重新启动我的机器。

    此外,我还安装了 MSVC 2015 64 位、MSVC 2017 32 位、MSVC 2017 64 位、Sources、Qt WebEngine 和 Qt Network Authorization 组件。

    最佳答案

    对于 Windows,我使用 bat 文件使用专有编解码器编译了 qtwebengine。

    创建 qt5vars.bat。粘贴到下面几行。将此文件放在 D:\Qt\Qt5.12.4\5.12.4\Src 文件夹中。

    @echo off

    REM Set up \Microsoft Visual Studio 2015, where <arch> is \c amd64, \c x86, etc.
    CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64_x86

    REM Edit this location to point to the source code of Qt
    SET _ROOT=D:\Qt\Qt5.12.4\5.12.4\Src

    SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%

    SET _ROOT=

    REM Keeps the command line open when this script is run.
    cmd /k

    运行bat文件。

    注意:对于 qtwebengine 编译,您需要启用长路径名支持,否则编译可能会失败。要启用它,请使用以下链接:
    https://superuser.com/questions/1119883/windows-10-enable-ntfs-long-paths-policy-option-missing

    关于qt - 在 msvc2017 上构建 Qt 5.12.4 的 qtwebengine 以启用专有编解码器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56933724/

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