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
I had all of those problems for the last 5 days.
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.
Please if you see any error, if have one by doing this or if some instruction is not clear, tell me so I can update
Go to https://www.visualstudio.com/fr/downloads/ and download Visual Studio 2017.
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.
Install and wait until it finishes.
Open MaintenanceTool.exe
present into the Qt folder
Add or delete module
Be sure to check at least: MSVC 2015 32-bit
, MSVC 2015 64-bit
, MSVC 2017 64-bit
, Sources
, Qt WebEngine
Install and wait until it finishes.
(Original instructions copied from Sébastien Bémelmans on this thread and a bit modified)
Download:
Be sure to add every .exe to System path, and restart the computer.
Open cmd.exe
(with administrator rights).
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"
Type vcvars32.bat
into command line
Type vcvars64.bat
into command line
Go to the path where Sources of Qt are and enter qtwebengine subdirectory:
cd "C:\Qt\5.11.0\Src\qtwebengine"
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)
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)
Your console should look like this (32 bit):
And the result:
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"
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"
into command line (note the x64 into the path)
Your command line should now output a lot of things. Compiling qt webengine requires lot of memory and space (around 90 Go on my computer and 60% of my 8 GO of RAM). Be sure to have place and free memory. It is long processing too
If you get a message below after running qmake:
"A suitable version of python2 could not be found."
download the configure file here.
Extract it and run "_configure.py" with python2. It will configure your qt and that error goes away.
One addition to Dardan Iljazi's answer. After successful compilation, I couldn't launch application with proprietary codecs support. I had to do the following in the same console:
nmake install
This command copies all output from previous work to the Qt installation folder. So I can use the same kit in Qt Creator to build and debug app with proprietary codecs support.
Also I was stuck once on detecting python2. Hint: to clean qmake step of build process manually remove config.* files in your qtwebengine folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With