Sunday, October 31, 2021

[SOLVED] Cross compile QtWebEngine for Raspberry Pi 4

Issue

I use qt-everywhere-src-5.15.0.tar.xz and gcc-linaro-7.4.1-2019.02-x86_64_arm- linux-gnueabihf toolchain on an Ubuntu 18 to cross compile Qt and especially QtWebEngine.

I use the following configure:

../qt-everywhere-src-5.15.0/configure \
  -opengl es2 -device linux-rasp-pi4-v3d-g++ \
  -device-option CROSS_COMPILE=~/raspi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- \
  -sysroot ~/raspi/sysroot \
  -prefix /usr/local/qt5pi \
  -opensource -confirm-license -no-gbm \
  -skip qtscript -skip qtandroidextras -skip qtcanvas3d \
  -skip qtgamepad -skip qtmacextras -skip qtpurchasing \
  -skip qtwinextras -skip qtx11extras \
  -nomake tests -nomake examples -make libs \
  -pkg-config -no-use-gold-linker -v

If I include "-skip qtwebengine" in the configure command, all the compilation works well, but when I include qtwebengine the configuration fails with the following warning:

WARNING: Could not find all necessary libraries for qpa-xcb support in QtWebEngine.
WARNING: QtWebEngine will not be built.

After searching a while, I know the reason for this warning. QtWebEngine uses pkg-config, to get the required libraries (e.g. xtst, xcomposite, ...) and take the libraries on my host system instead of using the copied packages from the raspberry.

How can I configure it, to use the copied files from the raspberry sysroot?


Solution

If the only libraries that seem to be missing are xtst, xcomposite, xi, etc. Those are located on the Pi in /usr/share. So your sysroot has to sync that folder as well.



Answered By - Andy