You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.7 KiB


Toolchain to build Qt Apps on a host system (like a X86 Desktop) and deploy it on a Raspberry Pi. Uses custom Qt and cross compiler.

This is a simplified and scripted version of: Read this if you using a different Raspberry as the Model B 2 or need X11 support.


Raspberry Pi with up-to-date GNU/Linux SSH Connection to host system


Setup Raspberry Pi

apt-get build-dep qt5-qmake
apt-get build-dep libqt5gui5
apt-get build-dep libqt5webengine-data
apt-get build-dep libqt5webkit5
apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0 gdbserver

Default Qt installation path is: "/usr/local/RaspberryQt"

mkdir /usr/local/RaspberryQt
chown -R pi:pi /usr/local/RaspberryQt
ln -s /opt/vc/lib/ /usr/lib/arm-linux-gnueabihf/ 
ln -s /opt/vc/lib/ /usr/lib/arm-linux-gnueabihf/ 
ln -s /opt/vc/lib/ /opt/vc/lib/ 
ln -s /opt/vc/lib/ /opt/vc/lib/

Setup host system

apt install libjasper-dev
apt-get install -y git cmake build-essential pkg-config libjpeg-dev libtiff5-dev libpng-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libatlas-base-dev gfortran wget unzip libz-dev zlib1g-dev gcc g++ git bison python gperf gdb-multiarch qt5-default texinfo make python3-dev

Create new SSH-Key for passwordless remote login

ssh-keygen -t rsa -C root@ -P "" -f ~/.ssh/rpi_root_id_rsa
cat ~/.ssh/ | ssh root@ 'cat >> .ssh/authorized_keys && chmod 640 .ssh/authorized_keys'

create folders

mkdir build
mkdir sysroot sysroot/usr sysroot/opt

copy sysroot to host

rsync -avz -e "ssh -p22 -i ~/.ssh/rpi_root_id_rsa" root@ sysroot
rsync -avz -e "ssh -p22 -i ~/.ssh/rpi_root_id_rsa" root@ sysroot/usr
rsync -avz -e "ssh -p22 -i ~/.ssh/rpi_root_id_rsa" root@ sysroot/usr
rsync -avz -e "ssh -p22 -i ~/.ssh/rpi_root_id_rsa" root@ sysroot/opt

run script to resolve requirements and build Qt


copy Qt to Raspberry Pi

rsync -avz -e "ssh -p22 -i ~/.ssh/rpi_root_id_rsa" sysroot/usr/local/RaspberryQt root@

Fix fonts (on Raspberry)

mkdir /usr/local/RaspberryQt/lib/fonts
cp /usr/share/fonts/truetype/dejavu/* /usr/local/RaspberryQt/lib/fonts


open demo/untitled/ with Qt Creator on host

For setting up the Qt Creator for remote deployment, see: