Build Qt-Lib with Qt Webengine

In this guides, we will embark on a journey through the process of building Qt with the WebEngine module. Whether you're a seasoned developer or new to the world of Qt, this tutorials are designed to provide you with (hhopefully) clear, step-by-step approaches to integrating WebEngine into your Qt projects.

Why Build Qt-lib From Scratch?

The Qt Company changed their business model and doesn't release binary LTS builds anymore. The LTS versions were published only in source code a year later.
This is by no means the only problem, as even the purchase of a commercial small business license presents complications when it comes to IoT and the so-called Qt device creation. After a few meetings with the sales department, the conclusion was to stick with the open-source license.

Furthermore, even the binary releases lack certain capabilities in Qt Webengine, such as proprietary codes for playing MP4 within the web browser component of the application. According to the laws of your country, it may be legal for you to activate these features.

Are There Not Enough Online Tutorials about Compiling Qt?

Probably not! Of course, there are numerous so-called guides on the net, but many authors “conveniently” skipped over critical parts like Qt Webengine. Because this piece of the Qt puzzle has been a pain in the ass for years. It takes forever, it is greedy for resources and if you face non-reproducible cryptic breaks, then be assured, it usually happens there. This happens quiet often shortly before finish after hours of compiling. Unfortunately, developer of digital signage apps do not have the luxury to avoid this annoyance with a simple -skip qtwebengine.

In the last years I found not even one "Build-Qt-Tutorial" that worked out-of-the-box. You will always encounter compile errors and end up in google information from different sources. Or waste your time reading useless forum communication with people, who misunderstand help with punishment and ego pushing. Chromium sources are brats in general. Upgrading the operating system or even using a Qt-LTS update can break build config setting which worked fine before.

For example:
  • From Qt5.15.7 to Qt5.15.8 you have to use a newer NDK r22b with jre-11 instead of ndk 21.1.x and jre-8 to build for Android.
  • From Qt5.15.11 Android compiles under Buster and Bullseye, but fails in Bookworm although using same parameters.
  • Qt Webengine for Linux fails with Debian Buster from Qt5.15.8 on. You need the gold linker, old binutils and some other complex changes. I decided to move to Bullseye, as latest version Bookworm give other problems.
  • etc.

Be prepared; errors will probably happens here, too. I am open for suggestions and if you were able to solve an issue - please write me and I publish your solution with a backlink in a troubleshoot section or in the article. But do the world a favour: Drop some explaining sentences. Better 20 words too much than one word less. I am honestly sick guessing to understand what some heroes in StackOverflow or in the Qt forums could probably want to explain.

  1. Build Qt5.15.11 with Qt Webengine for Win11 Pro

    How to build the Qt Lib including Qt Webengine on Windows 11 Pro using Visual Studio 2019 Community.

  2. Build Qt5.15.11 Universal Build with Qt Webengine for macOS Ventura

    As of the new Apples Silicon chips we had to find out, how to build the everything as universal binaries.

  3. Build Qt5.15.10/11 for Android with Debian

    Fortunately in Android Webengine is not supported, but there are enough other pitfalls.