如何在Windows上使用专有编解码器编译Qt Webengine(5.11) [英] How to compile Qt webengine (5.11) on Windows with proprietary codecs
问题描述
我在编译Qt网络引擎以启用专有编解码器时遇到很多麻烦,文档不是很清楚.我按照其他有关stackoverflow的说明进行操作,但是它不起作用.我收到类似这样的错误:
I have a lot of trouble compiling Qt webengine to enable proprietary codecs, documentation is not very clear. I followed others instructions on stackoverflow but it doesn't work. I got error like:
Project ERROR: Cannot run compiler 'cl'. Output:
===================
===================
Maybe you forgot to setup the environment?
OR
Needs VS 2015 Update 3 with Cumulative Servicing Release or higher
Qt WebEngine will not be built.
OR
Could not detect Windows SDK Version ('WindowsSDKVersion' environment variable is not set).
Qt Webengine on Windows requires a Windows SDK version 10.0.10586 or newer.
QtWebEngine will not be built.
OR
Needs Visual Studio 2017 or Higher
Qt WebEngine will not be built.
OR
C1905: Front end and back end not compatible (must target same processor).
LNK1257: code generation failed
推荐答案
在过去5天内,我都遇到了所有这些问题.
I had all of those problems for the last 5 days.
如果您不知道如何开始编译Qt Webengine(带有或不带有专有编解码器),我将按部就班地进行说明. 如果您已经完成了某些步骤,则可以随意跳过它们.
I'm doing a step by step instruction if you don't know how to begin with compiling Qt webengine (with or without proprietary codecs). If you have already done some of the steps, you can freely skip them.
如果您看到任何错误,执行此操作时遇到错误或不清楚某条指令,请告诉我,以便我进行更新
转到 https://www.visualstudio.com/fr/downloads/,然后下载Visual Studio 2017.
Go to https://www.visualstudio.com/fr/downloads/ and download Visual Studio 2017.
出现此窗口时,请检查Desktop Development for C++
,并确保已选中VC++ toolset 2015.3v v14.00 (v140)
和SDK Windows 10 (10.0.xxxxx.x)
.
When this window comes, check Desktop Development for C++
and be sure that VC++ toolset 2015.3v v14.00 (v140)
and SDK Windows 10 (10.0.xxxxx.x)
are checked.
安装并等待完成.
打开存在于Qt文件夹中的MaintenanceTool.exe
Open MaintenanceTool.exe
present into the Qt folder
添加或删除模块
请确保至少检查:MSVC 2015 32-bit
,MSVC 2015 64-bit
,MSVC 2017 64-bit
,Sources
,Qt WebEngine
Be sure to check at least: MSVC 2015 32-bit
, MSVC 2015 64-bit
, MSVC 2017 64-bit
, Sources
, Qt WebEngine
安装并等待完成.
(从SébastienBémelmans复制的原始说明,位于此线程并进行了一些修改)
(Original instructions copied from Sébastien Bémelmans on this thread and a bit modified)
下载:
- 来自 https://www的Python 2(实际上是2.7.15,不支持Python 3). python.org/downloads/windows/
- 来自 http://strawberryperl.com/ 的Perl(草莓味)
- https://sourceforge.net/projects/winflexbison/中的野牛和flex(重命名为win -bison.exe转换为bison.exe,将win-flex.exe转换为flex.exe) 来自 http://gnuwin32.sourceforge.net/packages/gperf.htm Gperf >
- Python 2 (2.7.15 actually, Python 3 is not supported) from https://www.python.org/downloads/windows/
- Perl (Strawberry vesion) from http://strawberryperl.com/
- Bison and flex from https://sourceforge.net/projects/winflexbison/ (Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe)
- Gperf from http://gnuwin32.sourceforge.net/packages/gperf.htm
确保将每个.exe添加到系统路径,然后重新启动计算机.
打开cmd.exe
(具有管理员权限).
Open cmd.exe
(with administrator rights).
类型cd
+ vcvarsall.bat
所在的Microsoft Visual Studio文件夹的路径:
type cd
+ Path to the Microsoft Visual Studio folder where vcvarsall.bat
is located:
cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build"
在命令行中输入vcvars32.bat
在命令行中输入vcvars64.bat
转到Qt来源所在的路径,然后输入qtwebengine子目录:
Go to the path where Sources of Qt are and enter qtwebengine subdirectory:
cd "C:\Qt\5.11.0\Src\qtwebengine"
用于编译为32位:
在命令行中输入"C:\Qt\5.11.0\msvc2015\bin\qmake.exe" -- -webengine-proprietary-codecs
(请注意链接将指向msvc 2015 32位)
For compilation into 32-bits:
Type "C:\Qt\5.11.0\msvc2015\bin\qmake.exe" -- -webengine-proprietary-codecs
into command line (note the link is going to msvc 2015 32 bit)
在命令行中输入"C:\Qt\5.11.0\msvc2017_64\bin\qmake.exe" -- -webengine-proprietary-codecs
(请注意,该链接将指向msvc 2017 64位)
Type "C:\Qt\5.11.0\msvc2017_64\bin\qmake.exe" -- -webengine-proprietary-codecs
into command line (note the link is going to msvc 2017 64 bit)
您的控制台应如下所示(32位):
Your console should look like this (32 bit):
结果:
现在,您需要致电nmake.键入版本32位或64位的nmake.exe的路径".像这样:
Now you need to call nmake. Type "Path to nmake.exe for version 32 bit or 64 bit" like this:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\Hostx86\x86\nmake.exe"
进入命令行(注意x86进入路径)
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\Hostx86\x86\nmake.exe"
into command line (note the x86 into the path)
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\Hostx64\x64\nmake.exe"
进入命令行(注意路径中的x64)
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\Hostx64\x64\nmake.exe"
into command line (note the x64 into the path)
您的命令行现在应该输出很多东西.编译qt 网络引擎需要大量内存和空间(大约90个硬盘空间 计算机和我的8 GO RAM中的60%).确保有地方免费 内存.处理时间也很长
这篇关于如何在Windows上使用专有编解码器编译Qt Webengine(5.11)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!