Skip to content
Guide for cross compiling QT 5.8 with piomxtextures for raspberry pi
Shell Python
Branch: master
Clone or download
Pull request Compare This branch is 11 commits ahead of Kukkimonsuta:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Cross compiling QT width piomxtextures

Based on, and


  • Uses the arm-rpi-4.9.3-linux-gnueabihf toolchain
  • Tested only on RPi 3 (but should support pi1/pi2 just fine)
  • Tested on clean Ubuntu 16.04 (64 bit) as host and clean Raspbian Jessie Lite 2017-01-11 on device
  • Make sure to use 64 bit host OS as that's what the used toolchain is built for
  • To use the toolchain once downloaded you must run source first to setup environment variables.


  1. on host install tools and clone this repo
    # install tools
    sudo apt-get install build-essential sshpass git python pkg-config
    # clone this repo
    mkdir -p ~/raspi
    cd ~/raspi
    git clone .
    # add executable permissions (this may not be required)
    chmod +x scripts/
    cd scripts  #always execute scripts from here
  2. update values in (RPIDEV_DEVICE_*, qt modules to install and optionally other settings)
  3. prepare RPi (ideally use clean 'RASPBIAN JESSIE LITE' image)
    # change gpu memory to 256 MB and Expand File System for SD Card
    sudo raspi-config
    # uncomment deb-src line
    sudo nano /etc/apt/sources.list
    # install qt dependencies
    sudo apt-get update
    sudo apt-get build-dep qt4-x11
    sudo apt-get build-dep libqt5gui5
    sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0 libsmbclient-dev libssh-dev libv4l-dev libboost1.55-all-dev libbz2-dev
    # remove gstreamer
    sudo apt-get purge gstreamer*
    # fix old egl
    sudo rm /usr/lib/arm-linux-gnueabihf/ /usr/lib/arm-linux-gnueabihf/
    sudo ln -s /opt/vc/lib/ /usr/lib/arm-linux-gnueabihf/
    sudo ln -s /opt/vc/lib/ /usr/lib/arm-linux-gnueabihf/
    # create qt install dir (must be at the path `QT_DEVICE_DIR`, owned by user `RPIDEV_DEVICE_USER` defined in ``)
    sudo mkdir -p /usr/local/qt5.8
    sudo chown pi:pi /usr/local/qt5.8
    # register the lib directory in ld
    echo /usr/local/qt5.8/lib | sudo tee /etc/
    # only if you want to compile qtwebengine
    sudo apt-get install libvpx-dev libvpx1 libvpx1-dbg libsrtp0 libsrtp0-dev libsnappy-dev
    # some more libs I added when qtwebengine errored halfway)
    sudo apt-get install gcc-multilib g++-multilib
    # some more candidates for libs you may be missing if you get an according error
    sudo apt-get install gperf bison flex libx32gcc-4.8-dev
  4. run, this will download all required repositories 4.1 run, this will download all qt modules given in
  5. run, this will connect to RPi and creates a sysroot for crosscompilation
  6. run, this will build and install qtbase
  7. run, this will build and install all qt modules given in Feel free to add more from (You can also do qtfoo for only qtfoo)
  8. run, this will build and install piomxtextures
  9. run, this will copy qt5 to the device
  10. on RPi run ldconfig
    sudo ldconfig
  11. ~/piomxtextures_pocplayer /opt/vc/src/hello_pi/hello_video/test.h264
You can’t perform that action at this time.