Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

raspberry pi cross compiling



  • I think learning c++ is easier than trying to get setup for cross compiling on the raspberry pi.

    I have a raspberry pi 3 with raspbian. My development computer is kubuntu 18.04.

    I'm following instructions here https://wiki.qt.io/RaspberryPi2EGLFS.

    First off step 10. states If your system is 64 bit you may also edit device option to:

    -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro- arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
    

    I was not even aware there was a 64 bit option for raspbian? It's not talking about my local system is it?


    As for the issues I'm running into, (unless I'm supposed to use the device-option above), I'm getting to the point of this, I'm putting 5.12 for my qt version

    git clone git://code.qt.io/qt/qtbase.git -b <qt-version>
    cd qtbase
    ./configure -release -opengl es2 -device <rpi-version> -device-option      CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-  gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot   -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix   ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v
    
    make
    make install
    

    However when I do ./configure here is the error I'm getting along with build options read out before it hits the error.

    Build options:
      Mode ................................... release
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      Using C standard ....................... C11
      Using C++ standard ..................... C++11
      Using ccache ........................... no
      Using gold linker ...................... no
      Using new DTAGS ........................ yes
      Using precompiled headers .............. yes
      Using LTCG ............................. no
      Target compiler supports:
       NEON ................................. yes
      Build parts ............................ libs
    Qt modules and options:
      Qt Concurrent .......................... yes
      Qt D-Bus ............................... yes
      Qt D-Bus directly linked to libdbus .... no
      Qt Gui ................................. yes
      Qt Network ............................. yes
      Qt Sql ................................. yes
      Qt Testlib ............................. yes
      Qt Widgets ............................. yes
      Qt Xml ................................. yes
    Support enabled for:
      Using pkg-config ....................... no
      udev ................................... no
      Using system zlib ...................... no
    Qt Core:
      DoubleConversion ....................... yes
        Using system DoubleConversion ........ no
      GLib ................................... no
      iconv .................................. yes
      ICU .................................... no
      Tracing backend ........................ <none>
      Logging backends:
        journald ............................. no
        syslog ............................... no
        slog2 ................................ no
      Using system PCRE2 ..................... no
    Qt Network:
      getifaddrs() ........................... yes
      IPv6 ifname ............................ yes
      libproxy ............................... no
      Linux AF_NETLINK ....................... yes
      OpenSSL ................................ no
        Qt directly linked to OpenSSL ........ no
      OpenSSL 1.1 ............................ no
      DTLS ................................... no
      SCTP ................................... no
      Use system proxies ..................... yes
    Qt Gui:
      Accessibility .......................... yes
      FreeType ............................... yes
        Using system FreeType ................ no
      HarfBuzz ............................... yes
        Using system HarfBuzz ................ no
      Fontconfig ............................. no
      Image formats:
        GIF .................................. yes
        ICO .................................. yes
         JPEG ................................. yes
           Using system libjpeg ............... no
        PNG .................................. yes
          Using system libpng ................ no
      EGL .................................... no
      OpenVG ................................. no
      OpenGL:
    Desktop OpenGL ....................... no
    OpenGL ES 2.0 ........................ no
    OpenGL ES 3.0 ........................ no
    OpenGL ES 3.1 ........................ no
    OpenGL ES 3.2 ........................ no
      Vulkan ................................. no
      Session Management ..................... yes
    Features used by QPA backends:
      evdev .................................. yes
      libinput ............................... no
      INTEGRITY HID .......................... no
      mtdev .................................. no
      tslib .................................. no
      xkbcommon .............................. no
      X11 specific:
        XLib ................................. no
        XCB Xlib ............................. no
        EGL on X11 ........................... no
    QPA backends:
      DirectFB ............................... no
       EGLFS .................................. no
      LinuxFB ................................ yes
      VNC .................................... yes
      Mir client ............................. no
    Qt Sql:
      SQL item models ........................ yes
    Qt Widgets:
      GTK+ ................................... no
      Styles ................................. Fusion Windows
    Qt PrintSupport:
     CUPS ................................... no
    Qt Sql Drivers:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... no
      PostgreSQL ............................. no
      SQLite2 ................................ no
       SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    Qt Testlib:
      Tester for item models ................. yes
    
    Note: Also available for Linux: linux-clang linux-icc
    
    ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32     || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed.
    
    ERROR: The OpenGL functionality tests failed!
    You might need to modify the include and library search paths by editing       QMAKE_INCDIR_OPENGL[_ES2],
    QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.

  • Lifetime Qt Champion

    @NR5P said in raspberry pi cross compiling:

    I think learning c++ is easier than trying to get setup for cross compiling on the raspberry pi

    I disagree. Why do you want to use Raspberry Pi and cross compiling just to learn C++? Cross compiling is a complex area and makes it harder to even get a working development environment. It is way easier to either write code for your PC or do it on Raspberry Pi.



  • Sorry meant to say learning c++ seemed easier. I'm building an automation program with QT. https://github.com/NR5P/homestead_automation . I try to work on stuff when I get time at work and I figured cross compiling would make it easier to work on it and test when I'm not at home. I don't really want to bring the pi with me.


  • Lifetime Qt Champion

    @NR5P It looks like OpenGL/ES header/libs are missing in your sysroot.
    You can call configure with -v parameter to see what exactly is missing.



  • Using the sourcecode qt-everywhere-src-5.12.0 will be fine.
    https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/

    If the sourcecode version newer than 5.12.0, it must getting "The OpenGL functionality tests failed!" Error.

    None of [libGLESv2.so libGLESv2.a] found in [/home/alex/raspi/sysroot/usr/lib/arm-linux-gnueabihf] and global paths.
    => source produced no result.

    I have check those files is really exist, but system can not detected.


Log in to reply