Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. cross compiling for ubuntu 21.10 on raspberry pi 4
QtWS25 Last Chance

cross compiling for ubuntu 21.10 on raspberry pi 4

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
raspberry pi 4ubuntu 21.04cross compile
6 Posts 3 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kingfranz
    wrote on last edited by
    #1

    I've been trying for days to compile Qt 5.15.2 for raspberry pi 4 running ubuntu 21.10 (host PC running ubuntu 20.04) with no luck.
    Every guide I've found targets raspbian, not ubuntu and I'm getting lots of 'libs not found' or 'invalid file format'

    Have anyone tried this?

    My command line looks like this

    ../qt-everywhere-src-5.15.2/configure -release
    -opengl es2
    -eglfs
    -device linux-rasp-pi4-v3d-g++
    -device-option CROSS_COMPILE=/home/soren/piqt/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf-
    -sysroot /home/soren/piqt/sysroot
    -prefix /usr/local/RaspberryQt
    -L/home/soren/piqt/sysroot/usr/lib
    -I/home/soren/piqt/sysroot/usr/include
    QMAKE_LIBS_OPENGL_ES2+="-Wl,-rpath,/home/soren/piqt/sysroot/usr/lib/"
    QMAKE_LIBS_EGL+="-Wl,-rpath,/home/soren/piqt/sysroot/usr/lib/"
    -opensource
    -confirm-license
    -skip qtscript
    -skip qtwayland
    -skip qtwebengine
    -skip qtlocation
    -skip qtmultimedia
    -skip qt3d
    -skip qtgamepad
    -skip qtconnectivity
    -skip qtsensors
    -skip qtquick3d
    -skip serialport
    -nomake tests
    -nomake examples
    -no-flite
    -no-flite-alsa
    -no-speechd
    -no-dbus
    -no-libudev
    -no-zlib
    -no-zstd
    -no-icu
    -no-doubleconversion
    -no-freetype
    -no-harfbuzz
    -no-d3d12
    -no-use-gold-linker
    -no-sqlite
    -make libs
    -pkg-config
    -v
    -recheck

    Help

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Does your sysroot contain all the development packages required to build Qt ?

      Usually, invalid file format means that some of the files used are for a different architecture.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kingfranz
        wrote on last edited by
        #3

        Hi,
        My "top" level looks like this

        drwxrwxr-x 7 soren users 4096 apr 11 00:10 ./
        drwxr-xr-x 126 soren users 36864 apr 11 00:26 ../
        drwxrwxr-x 20 soren users 4096 apr 11 00:10 build/
        drwxrwxr-x 2 soren users 4096 apr 9 14:39 qtbase/
        drwxr-xr-x 46 soren users 4096 nov 12 2020 qt-everywhere-src-5.15.2/
        drwxr-xr-x 8 soren users 4096 sep 4 2019 rpi-gcc-8.3.0/
        drwxrwxr-x 4 soren users 4096 apr 9 08:31 sysroot/
        -rwxrwxr-x 1 soren users 959 apr 9 08:01 sysroot-relativelinks.py*

        and sysroot

        drwxrwxr-x 4 soren users 4096 apr 9 08:31 ./
        drwxrwxr-x 7 soren users 4096 apr 11 00:10 ../
        drwxrwxr-x 2 soren users 4096 apr 9 08:12 opt/
        drwxrwxr-x 4 soren users 4096 apr 9 08:32 usr/

        "opt" is empty on a clean ubuntu and usr have the complete lib and include tree from the target, which is up to date and have the dev packages installed, but maybe I'm missing something.

        I changed the QMAKE_LIBS_OPENGL_ES2 and QMAKE_LIBS_EGL to /home/soren/piqt/sysroot/usr/lib/aarch64-linux-gnu/ (because that's where those libs are) and ld still says it can't find them.

        /home/soren/piqt/rpi-gcc-8.3.0/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lGLESv2
        /home/soren/piqt/rpi-gcc-8.3.0/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lEGL
        collect2: error: ld returned 1 exit status
        make: *** [Makefile:67: opengl_es2] Error 1
        => source failed verification.
        test config.qtbase_gui.libraries.opengl_es2 FAILED

        At least it stopped saying invalid file format :-)

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Usually the sysroot is a copy of the target root filesystem or a live mount through sshfs or nfs.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • K Offline
            K Offline
            kingfranz
            wrote on last edited by
            #5

            Not in the guides I've seen. There they just copy /usr/lib, /usr/include and /opt.

            And regarding if I have all the dev packages. How would I know? I haven't found any info of what is needed.

            Is there some kind of documentation on how to build it?

            jsulmJ 1 Reply Last reply
            0
            • K kingfranz

              Not in the guides I've seen. There they just copy /usr/lib, /usr/include and /opt.

              And regarding if I have all the dev packages. How would I know? I haven't found any info of what is needed.

              Is there some kind of documentation on how to build it?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @kingfranz said in cross compiling for ubuntu 21.10 on raspberry pi 4:

              /usr/lib, /usr/include and /opt

              Yes, you do not have to copy whole root file system.

              "I haven't found any info of what is needed" - what is needed heavilly depends on what parts of Qt you want to build. What you can do is: run configure with your current sysroot, see which tests fail and for those you need check why they fail (check configure.log file) and install missing dev packages.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved