To cross-compile Qt 5.12.0 on PI I followed this tutorial
I made the following edits, though, to compile QtWebEngine too.
Using Raspbian Stretch Lite 2018-11, 4.19.40-v7+
ON RPi:
sudo rpi-update
reboot
sudo raspi-config
here enable SSH and hardware acceleration; increase GPU ram.
ON HOST SYSTEM:
sudo apt-get update
sudo apt-get install g++-multilib python pkg-config gperf bison flex libnss3-dev
Step 1: On RPi
sudo nano /etc/apt/sources.list
and uncomment last line
sudo apt-get update
sudo apt-get install libnss3-dev libfontconfig1-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libdbus-1-dev libssl-dev
Step 2: on RPI,
sudo mkdir /usr/local/qt5pi
sudo chown pi:pi /usr/local/qt5pi
Step 3: on HOST SYSTEM
mkdir -p ~/raspi/tools
extract in ~/raspi/tools https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/arm-linux-gnueabihf/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz
Step 4: on HOST SYSTEM
rsync -avzR pi@192.168.120.184:/lib :/usr/include :/usr/lib :/opt/vc ~/raspi/sysroot
(being 192.168.120.184 my PI ip)
wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
chmod +x sysroot-relativelinks.py
./sysroot-relativelinks.py sysroot
Step 5: on HOST SYSTEM
wget http://download.qt.io/official_releases/qt/5.12/5.12.0/single/qt-everywhere-src-5.12.0.tar.xz qt-everywhere-src-5.12.0.tar.xz
Step 6: on HOST SYSTEM
cd qt-everywhere-src-5.12.0
./configure -release -opengl es2 -device linux-rasp-pi3-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 -opensource -confirm-license -skip qtwayland -skip qtscript -skip qtandroidextras -skip qtcanvas3d -skip qtgamepad -skip qtmacextras -skip qtpurchasing -skip qtquickcontrols -skip qtwinextras -skip qtx11extras -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -no-gbm -nomake examples -nomake tests
(-v to make it verbose)
Check the output to see what will be installed
Step 7: on HOST SYSTEM
make -j 4
(expect to go out of memory; just relaunch)
make install
Launch rsync -avz qt5pi pi@192.168.120.184:/usr/local
(to copy the compiled libs to the RPi)
Pingback: Cross-compiling Qt 5.12.3 (with QtWebEngine) for Raspberry Pi 3 = Headache | OttyCodes
MoesKiste ha detto:
if you create an qt application inside Qtcreator… does it run fullscreen with no problems?
i have two errors:
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
QFontDatabase: Cannot find font directory /usr/local/qt5pi/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
Otty ha detto:
Yes, I can run an application fullscreen without problems.
The “Unable to query physical screen size” is ok since there is no way for the EGLFS plugin to know the monitor specs.
I never had the font problem; which modules did you use? Or it does happen even with a empty application?
pscaffardi ha detto:
did you got QT+webengine compiled for Raspberry Pi 0?
Otty ha detto:
Sorry, I have only a Pi3
Pingback: Cross-compiling Qt 5.12.3 (with QtWebEngine) for Raspberry Pi 4 = Headache | OttyCodes
Pawel ha detto:
Hi, this tutorial should be similar for cross-compiling Qt for Raspian Buster and Raspberry Pi 4? I have a lot of problems with compiling webengine..
Otty ha detto:
Paweł Gontarz ha detto:
Unfortunately, still is warning about WebEngine after ./configgure:
Thumb instruction set is required to build ffmpeg for QtWebEngine. Any idea?
Otty ha detto:
Eh, I remember I had that error once, but I don’t remember how I solved it, sorry…
Tbh it isn’t mandatory to compile QtWebEngine.
Paweł Gontarz ha detto:
I know, but i need to show website in my project
Paweł Gontarz ha detto:
Maybe you had to install additional libraries?
Otty ha detto:
You don’t need ffmpeg to show websites, that could have been only a warning and not a direct cause of failure.
Otty ha detto:
Anyway, that message appears with the following condition:
config.linux && features.webengine-embedded-build && !features.webengine-system-ffmpeg && arch.arm && !features.webengine-arm-thumb
Paweł Gontarz ha detto:
Is there other option to show website in qml? Using WebView also dont work and show error: No webview plug-in found!
About condition you wrote, what i should do with this?
Thank You for fast answers 🙂
Otty ha detto:
You should ./configure in verbose mode to see exactly which tests are failing, then take a look at the code to see what makes the test fail