Important: Please read the Qt Code of Conduct -

Installing required libraries on latest Buster for RPi cross-compile

  • I'd like to cross-compile Qt for RPi with latest Buster OS installed, and following this guide or this other one, when installing the required libraries on the board, by running the command:

    sudo apt-get build-dep libqt5gui5

    I'm getting lots and lots of packages to be installed, including Qt binaries (modules, i.e. libqt5core5a libqt5dbus5 libqt5designer5
    libqt5designercomponents5 libqt5gui5 libqt5help5 libqt5network5 libqt5positioning5 libqt5printsupport5 libqt5qml5 libqt5quick5 libqt5quickwidgets5 libqt5sensors5 libqt5sql5 libqt5sql5-sqlite libqt5webchannel5 libqt5webkit5 libqt5widgets5 libqt5xml5).

    Is that right?
    Has anybody gone through this already?

    pi@rpi3:~ $ sudo apt-get build-dep libqt5gui5
    Reading package lists... Done
    Picking 'qtbase-opensource-src' as source package instead of 'libqt5gui5'
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following NEW packages will be installed:
      adwaita-icon-theme autoconf automake autopoint autotools-dev dbus-user-session
      dconf-gsettings-backend dconf-service debhelper default-libmysqlclient-dev dh-autoreconf dh-exec
      dh-strip-nondeterminism dwz firebird-dev firebird3.0-common firebird3.0-common-doc fontconfig
      fontconfig-config fonts-dejavu-core freetds-common freetds-dev gettext gir1.2-atk-1.0
      gir1.2-atspi-2.0 gir1.2-freedesktop gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-gtk-3.0
      gir1.2-harfbuzz-0.0 gir1.2-pango-1.0 glib-networking glib-networking-common
      glib-networking-services gsettings-desktop-schemas gtk-update-icon-cache hicolor-icon-theme
      icu-devtools intltool-debian libarchive-zip-perl libasound2-dev libasyncns0 libatk-bridge2.0-0
      libatk-bridge2.0-dev libatk1.0-0 libatk1.0-data libatk1.0-dev libatspi2.0-0 libatspi2.0-dev
      libavahi-client3 libblkid-dev libbrotli1 libcairo-gobject2 libcairo-script-interpreter2
      libcairo2 libcairo2-dev libclang1-7 libcolord2 libcroco3 libct4 libcups2 libcups2-dev
      libcupsimage2 libcupsimage2-dev libdatrie1 libdbus-1-dev libdconf1 libdouble-conversion-dev
      libdouble-conversion1 libegl-dev libegl-mesa0 libegl1 libegl1-mesa-dev libepoxy-dev libepoxy0
      libevdev-dev libevdev2 libexpat1-dev libfbclient2 libffi-dev libfile-stripnondeterminism-perl
      libflac8 libfontconfig1 libfontconfig1-dev libfribidi-dev libgbm-dev libgbm1 libgdk-pixbuf2.0-0
      libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgdk-pixbuf2.0-dev libgirepository-1.0-1
      libgl-dev libgl1 libgl1-mesa-dev libgles-dev libgles1 libgles2 libgles2-mesa-dev libglib2.0-bin
      libglib2.0-dev libglib2.0-dev-bin libglu1-mesa libglu1-mesa-dev libglvnd0 libglx-dev
      libglx-mesa0 libglx0 libgmp-dev libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27
      libgnutls28-dev libgnutlsxx28 libgraphite2-3 libgraphite2-dev libgstreamer-plugins-base1.0-0
      libgstreamer1.0-0 libgtk-3-0 libgtk-3-common libgtk-3-dev libgudev-1.0-0 libharfbuzz-dev
      libharfbuzz-gobject0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libib-util libice-dev libice6
      libicu-dev libidn2-dev libinput-bin libinput-dev libinput10 libjbig-dev libjbig0 libjpeg-dev
      libjpeg62-turbo-dev libjson-glib-1.0-0 libjson-glib-1.0-common liblcms2-2 libllvm7 libltdl-dev
      libltdl7 liblzma-dev liblzo2-2 libmariadb-dev libmariadb-dev-compat libmariadb3 libmount-dev
      libmtdev-dev libmtdev1 libodbc1 libogg0 liborc-0.4-0 libp11-kit-dev libpango-1.0-0
      libpango1.0-dev libpangocairo-1.0-0 libpangoft2-1.0-0 libpangoxft-1.0-0 libpcre16-3
      libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre3-dev libpcre32-3 libpcrecpp0v5 libpixman-1-0
      libpixman-1-dev libpq-dev libpq5 libproxy-dev libproxy1v5 libpthread-stubs0-dev libpulse-dev
      libpulse-mainloop-glib0 libpulse0 libqt5core5a libqt5dbus5 libqt5designer5
      libqt5designercomponents5 libqt5gui5 libqt5help5 libqt5network5 libqt5positioning5
      libqt5printsupport5 libqt5qml5 libqt5quick5 libqt5quickwidgets5 libqt5sensors5 libqt5sql5
      libqt5sql5-sqlite libqt5webchannel5 libqt5webkit5 libqt5widgets5 libqt5xml5 librest-0.7-0
      librsvg2-2 librsvg2-common libselinux1-dev libsepol1-dev libsigsegv2 libsm-dev libsm6
      libsndfile1 libsoup-gnome2.4-1 libsoup2.4-1 libsqlite3-dev libssl-dev libsybdb5 libtasn1-6-dev
      libthai-data libthai0 libtiff-dev libtiff5 libtiffxx5 libtommath1 libtool libudev-dev
      libunbound8 libvorbis0a libvorbisenc2 libvulkan-dev libvulkan1 libwacom-common libwacom-dev
      libwacom2 libwayland-bin libwayland-client0 libwayland-cursor0 libwayland-dev libwayland-egl1
      libwayland-server0 libwebp6 libwoff1 libx11-dev libx11-xcb-dev libx11-xcb1 libxau-dev
      libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-icccm4 libxcb-icccm4-dev libxcb-image0
      libxcb-image0-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-present0 libxcb-randr0
      libxcb-randr0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-render0 libxcb-render0-dev
      libxcb-shape0 libxcb-shape0-dev libxcb-shm0 libxcb-shm0-dev libxcb-sync-dev libxcb-sync1
      libxcb-util0 libxcb-xfixes0 libxcb-xfixes0-dev libxcb-xinerama0 libxcb-xinerama0-dev
      libxcb-xkb-dev libxcb-xkb1 libxcb1-dev libxcomposite-dev libxcomposite1 libxcursor-dev
      libxcursor1 libxdamage-dev libxdamage1 libxdmcp-dev libxext-dev libxfixes-dev libxfixes3
      libxft-dev libxft2 libxi-dev libxi6 libxinerama-dev libxinerama1 libxkbcommon-dev
      libxkbcommon-x11-0 libxkbcommon-x11-dev libxkbcommon0 libxrandr-dev libxrandr2 libxrender-dev
      libxrender1 libxshmfence1 libxslt1.1 libxtst-dev libxtst6 libxxf86vm1 m4 mariadb-common
      mysql-common nettle-dev odbcinst odbcinst1debian2 pango1.0-tools pkg-kde-tools po-debconf
      python3-distutils python3-lib2to3 qdoc-qt5 qt5-assistant qtchooser qttools5-dev-tools
      unixodbc-dev uuid-dev wayland-protocols x11-common x11proto-composite-dev x11proto-core-dev
      x11proto-damage-dev x11proto-dev x11proto-fixes-dev x11proto-input-dev x11proto-randr-dev
      x11proto-record-dev x11proto-xext-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev
    0 upgraded, 331 newly installed, 0 to remove and 0 not upgraded.
    Need to get 120 MB/120 MB of archives.
    After this operation, 440 MB of additional disk space will be used.
    Do you want to continue? [Y/n] 

  • Qt Champions 2019

    @Pablo-J-Rogina said in Installing required libraries on latest Buster for RPi cross-compile:


    No need to install this one, but you can do so to get all needed packages faster. Else run configure and check the output. Install *-dev packages for everything you need which is marked as "not found/disabled".

  • @jsulm thank you for the suggestion.

    I realized that I'd rather give it a try to ArchLinuxARM as the OS, since it provides aarch64 version for RPi3 devices, along with pre-built binaries for such platform.

  • @Pablo-J-Rogina as a follow-up, it looks like my plan with ArchlinuxARM failed.

    After installing Qt libraries (and dependencies) on the target, and rsync'ng the sysroot on the host, I was not able to create a proper kit in Qt Creator since there's no qmake that runs on host but refers to cross-compiling settings.

    Before moving back to actually cross-compiling Qt libraries, I guess I'll attempt another approach:

    • Install pre-built Qt libraries on target
    • Install distcc and cross-compile toolchain in host
    • Not sure if I need a sysroot on host
    • Still not sure how to set the kit in Qt Creator (since the qmake exe will be in target anyway)

Log in to reply