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

Raspberry Pi 3 B+ cross compile QT5



  • Hi,

    Any one is able to build and install a working cross compile on raspberry pi 3 b+,
    I'm looking for it for 2 weeks and I cant put nothing that works together.
    This is my first time with qt environment and I love to try cross compile, so:

    You can build and install a cross compile in ubuntu and raspberry pi 3 b+?
    what version of ubuntu and raspberry pi do you use?
    do you follow a tutorial? what tutorial?
    any other thoughts?

    thanks


  • Moderators

    @dedetuga said in Raspberry Pi 3 B+ cross compile QT5:

    You can build and install a cross compile in ubuntu and raspberry pi 3 b+?

    Yes.

    what version of ubuntu and raspberry pi do you use?

    Ubuntu: any. It does not matter.

    RPi: 2, 3 (most probably also 4 but I have not tried).

    With RPi 1 and Zero it is also possible, but harder.

    Qt: 5.10.1 and 5.11.x tend to work well. I've had some issues with 5.12.x (but I think the newest one (5.12.4) works fine) and I have not tried 5.13 yet.

    do you follow a tutorial? what tutorial?

    This one: https://wiki.qt.io/RaspberryPi2EGLFS although not to the letter - I simplify it and compile in a different way.

    Here is my script:

    export QTVER=5.11.1
    wget http://download.qt.io/official_releases/qt/5.11/$QTVER/single/qt-everywhere-src-$QTVER.tar.xz
    tar -xaf qt-everywhere-src-$QTVER.tar.xz
    mv qt-everywhere-src-$QTVER $QTVER-src
    mkdir qtbuild
    cd qtbuild
    ../$QTVER-src/configure -device linux-rasp-pi3-g++ -opengl es2 -confirm-license -opensource -release -nomake examples -skip qtwebview -skip qt3d -skip qtquick1 -skip qtwayland -skip qtvirtualkeyboard -skip qtwebchannel -skip qtwebengine -skip qtscript -skip qtscxml -skip qtspeech -skip qtpurchasing -skip qtgamepad -skip qtserialbus -skip qtlocation -no-use-gold-linker -device-option CROSS_COMPILE=/path/toi/your/toolchain- -sysroot /path/to/your/sysroot -prefix /home/pi/$QTVER-cross -extprefix $PWD//../$QTVER-cross -hostprefix $PWD/../$QTVER -v
    make -j `nproc`
    make install
    
    -hostprefix - this is where Qt will be built (make)
    -extprefix - this is where Qt will be installed (make install)
    -prefix - this is where Qt will be placed (on target device!)
    

    About all these -skip lines: there are 2 possibilities: either skip modules you don't need, or (simpler!) remove the module folders from $QTVER-src and run configure without any -skip flags.

    After compilation is done, you can safely remove $QTVER-src folder and qtbuild folder. Your whole Qt installation (cross-compiled) is in $QTVER-cross (copy that to your Pi), and your host tools are in $QTVER (you can compile apps for RPi on your host Ubuntu using these tools (qmake)).

    any other thoughts?

    Good luck :-) It's hard to get this right the first time you try :-)



  • Hi @sierdzio thanks for reply.

    I will try you script soon!!!

    What version of raspian stretch do you use?
    I want minimize all possibilities of errors

    Thanks


  • Moderators

    @dedetuga said in Raspberry Pi 3 B+ cross compile QT5:

    What version of raspian stretch do you use?

    The latest, always.

    Right now I'm on Buster, but last time I compiled Qt for RPi, it was on Stretch.



  • [0_1563180614612_FullError.txt.rar](Uploading 100%) Hi @sierdzio,
    After run your configure command I got:

    ../$QTVER-src/configure -device linux-rasp-pi3-g++ -opengl es2 -confirm-license -opensource -release -nomake examples -skip qtwebview -skip qt3d -skip qtquick1 -skip qtwayland -skip qtvirtualkeyboard -skip qtwebchannel -skip qtwebengine -skip qtscript -skip qtscxml -skip qtspeech -skip qtpurchasing -skip qtgamepad -skip qtserialbus -skip qtlocation -no-use-gold-linker -device-option CROSS_COMPILE=~/Qt-Cross-Compile/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/Qt-Cross-Compile/sysroot/ -prefix /home/pi/$QTVER-cross -extprefix ~/Qt-Cross-Compile/$QTVER-cross -hostprefix ~/Qt-Cross-Compile/$QTVER -v
    
    
    
    
    Configure summary:
    
    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: devices/linux-rasp-pi3-g++ (arm, CPU features: neon)
    Configuration: cross_compile compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 concurrent dbus reduce_exports stl
    Build options:
      Mode ................................... release
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      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 .... yes
      Qt Gui ................................. yes
      Qt Network ............................. yes
      Qt Sql ................................. yes
      Qt Testlib ............................. yes
      Qt Widgets ............................. yes
      Qt Xml ................................. yes
    Support enabled for:
      Using pkg-config ....................... yes
      udev ................................... yes
      Using system zlib ...................... yes
    Qt Core:
      DoubleConversion ....................... yes
        Using system DoubleConversion ........ yes
      GLib ................................... yes
      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 ................................ yes
        Qt directly linked to OpenSSL ........ no
      OpenSSL 1.1 ............................ no
      SCTP ................................... no
      Use system proxies ..................... yes
    Qt Gui:
      Accessibility .......................... yes
      FreeType ............................... yes
        Using system FreeType ................ yes
      HarfBuzz ............................... yes
        Using system HarfBuzz ................ no
      Fontconfig ............................. yes
      Image formats:
        GIF .................................. yes
        ICO .................................. yes
        JPEG ................................. yes
          Using system libjpeg ............... yes
        PNG .................................. yes
          Using system libpng ................ yes
      EGL .................................... yes
      OpenVG ................................. no
      OpenGL:
        Desktop OpenGL ....................... no
        OpenGL ES 2.0 ........................ yes
        OpenGL ES 3.0 ........................ yes
        OpenGL ES 3.1 ........................ yes
        OpenGL ES 3.2 ........................ yes
      Vulkan ................................. no
      Session Management ..................... yes
    Features used by QPA backends:
      evdev .................................. yes
      libinput ............................... yes
      INTEGRITY HID .......................... no
      mtdev .................................. yes
      tslib .................................. yes
      xkbcommon-evdev ........................ yes
    QPA backends:
      DirectFB ............................... no
      EGLFS .................................. yes
      EGLFS details:
        EGLFS OpenWFD ........................ no
        EGLFS i.Mx6 .......................... no
        EGLFS i.Mx6 Wayland .................. no
        EGLFS RCAR ........................... no
        EGLFS EGLDevice ...................... no
        EGLFS GBM ............................ yes
        EGLFS VSP2 ........................... no
        EGLFS Mali ........................... no
        EGLFS Raspberry Pi ................... yes
        EGL on X11 ........................... no
      LinuxFB ................................ yes
      VNC .................................... yes
      Mir client ............................. no
      X11:
        Using system-provided XCB libraries .. yes
        EGL on X11 ........................... no
        Xinput2 .............................. yes
        XCB XKB .............................. yes
        XLib ................................. yes
        XCB render ........................... yes
        XCB GLX .............................. yes
        XCB Xlib ............................. yes
        Using system-provided xkbcommon ...... no
        Native painting (experimental) ....... yes
    Qt Widgets:
      GTK+ ................................... no
      Styles ................................. Fusion Windows
    Qt PrintSupport:
      CUPS ................................... yes
    Qt Sql:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. yes
      SQLite2 ................................ yes
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... yes
    Qt Testlib:
      Tester for item models ................. yes
    QtXmlPatterns:
      XML schema support ..................... yes
    Qt QML:
      QML network support .................... yes
      QML debugging and profiling support .... yes
      QML delegate model ..................... yes
    Qt Quick:
      Direct3D 12 ............................ no
      AnimatedImage item ..................... yes
      Canvas item ............................ yes
      Support for Qt Quick Designer .......... yes
      Flipable item .......................... yes
      GridView item .......................... yes
      ListView item .......................... yes
      Path support ........................... yes
      PathView item .......................... yes
      Positioner items ....................... yes
      Repeater item .......................... yes
      ShaderEffect item ...................... yes
      Sprite item ............................ yes
    Qt Bluetooth:
      BlueZ .................................. yes
      BlueZ Low Energy ....................... yes
      Linux Crypto API ....................... yes
      WinRT Bluetooth API (desktop & UWP) .... no
    Qt Sensors:
      sensorfw ............................... no
    Qt Quick Controls 2:
      Styles ................................. Default Fusion Imagine Material Universal
    Qt Quick Templates 2:
      Hover support .......................... yes
      Multi-touch support .................... yes
    Qt Multimedia:
      ALSA ................................... yes
      GStreamer 1.0 .......................... yes
      GStreamer 0.10 ......................... no
      Video for Linux ........................ yes
      OpenAL ................................. yes
      PulseAudio ............................. yes
      Resource Policy (libresourceqt5) ....... no
      Windows Audio Services ................. no
      DirectShow ............................. no
      Windows Media Foundation ............... no
    
    Note: Also available for Linux: linux-clang linux-icc
    
    Note: PKG_CONFIG_LIBDIR automatically set to /home/filipe/Qt-Cross-Compile/sysroot//usr/lib/pkgconfig:/home/filipe/Qt-Cross-Compile/sysroot//usr/share/pkgconfig:/home/filipe/Qt-Cross-Compile/sysroot//usr/lib/arm-linux-gnueabihf/pkgconfig
    
    Note: PKG_CONFIG_SYSROOT_DIR automatically set to /home/filipe/Qt-Cross-Compile/sysroot/
    
    Note: Dropped compiler flags '-pthread' when detecting library 'glib'.
    
    Note: Dropped compiler flags '-pthread' when detecting library 'gstreamer'.
    
    Note: Dropped compiler flags '-pthread' when detecting library 'gstreamer_app'.
    
    Qt is now configured for building. Just run 'make'.
    Once everything is built, you must run 'make install'.
    Qt will be installed into '/home/filipe/Qt-Cross-Compile/5.11.1-cross'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    
    

    And after run you command "make -j nproc" I got this error:

    /home/filipe/Qt-Cross-Compile/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/filipe/Qt-Cross-Compile/sysroot/ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../../lib -Wl,-rpath-link,/home/filipe/Qt-Cross-Compile/sysroot/opt/vc/lib -Wl,-rpath-link,/home/filipe/Qt-Cross-Compile/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/filipe/Qt-Cross-Compile/sysroot/lib/arm-linux-gnueabihf -shared -o libqxcb.so .obj/qxcbmain.o  -L=/opt/vc/lib -L/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/lib -lQt5XcbQpa -L/home/filipe/Qt-Cross-Compile/sysroot//usr/lib/arm-linux-gnueabihf -lQt5ServiceSupport -lQt5ThemeSupport -lQt5EventDispatcherSupport -lgthread-2.0 -lglib-2.0 -lQt5FontDatabaseSupport -lfontconfig -lfreetype -lQt5LinuxAccessibilitySupport -lQt5AccessibilitySupport -lQt5Gui -lQt5EdidSupport -lQt5DBus -lQt5Core -lGLESv2 -lpthread -lX11 -lX11-xcb -lXi -lXrender -lxcb-xkb -lxcb-render-util -lxcb-render -lxcb -lxcb-shm -lxcb-sync -lxcb-xfixes -lxcb-xinerama -lxcb-randr -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-shape -ldl  
    rm -f libqsqlite.so
    /home/filipe/Qt-Cross-Compile/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/filipe/Qt-Cross-Compile/sysroot/ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../../lib -Wl,-rpath-link,/home/filipe/Qt-Cross-Compile/sysroot/opt/vc/lib -Wl,-rpath-link,/home/filipe/Qt-Cross-Compile/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/filipe/Qt-Cross-Compile/sysroot/lib/arm-linux-gnueabihf -shared -o libqsqlite.so .obj/qsql_sqlite.o .obj/smain.o .obj/sqlite3.o .obj/moc_qsql_sqlite_p.o  -L/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/lib -lQt5Sql -lQt5Core -lpthread  
    mv -f libqxcb.so ../../../../plugins/platforms/ 
    make[6]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/platforms/xcb'
    cd gl_integrations/ && ( test -e Makefile || /home/filipe/Qt-Cross-Compile/qtbuild/qtbase/bin/qmake -o Makefile /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro ) && make -f Makefile 
    mv -f libqsqlite.so /home/filipe/Qt-Cross-Compile/qtbuild/qtbase/plugins/sqldrivers/ 
    make[5]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/sqldrivers/sqlite'
    make[4]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/sqldrivers'
    make[6]: Entering directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/platforms/xcb/gl_integrations'
    make[6]: Nothing to be done for 'first'.
    make[6]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/platforms/xcb/gl_integrations'
    make[5]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/platforms/xcb'
    make[4]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/platforms'
    Makefile:102: recipe for target 'sub-platforms-make_first' failed
    make[3]: *** [sub-platforms-make_first] Error 2
    make[3]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins'
    Makefile:776: recipe for target 'sub-plugins-make_first' failed
    make[2]: *** [sub-plugins-make_first] Error 2
    make[2]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src'
    Makefile:48: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase'
    Makefile:70: recipe for target 'module-qtbase-make_first' failed
    make: *** [module-qtbase-make_first] Error 2
    

    I copy and paste the terminal output and share it here -> Full error

    what can I do?
    I'm having this kind of error every time I try build an cross compile

    thanks


  • Moderators

    There is no error in the output you pasted. Look earlier in the compilation log (because you are compiling with multiple threads, the logs are mixed, and the actual error can happen long before make will finish all threads), or run make again, without cleaning anything, and without -j flag. Then the actual error should show up closer the end of the log.



  • @sierdzio thanks for the tip, now I realize this is why I never can track the error! hahahahah!!! Embarrassing ...

    any way I think is this you asked for:

    /qtbase/mkspecs/devices/linux-rasp-pi3-g++ -o .obj/qeglfskmsgbmwindow.o /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp
    /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp: In member function ‘virtual void QEglFSKmsGbmWindow::resetSurface()’:
    /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:58:5: error: ‘PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC’ was not declared in this scope
         PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC createPlatformWindowSurface = nullptr;
         ^
    /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:58:46: error: expected ‘;’ before ‘createPlatformWindowSurface’
         PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC createPlatformWindowSurface = nullptr;
                                                  ^
    /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:61:9: error: ‘createPlatformWindowSurface’ was not declared in this scope
             createPlatformWindowSurface = reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
             ^
    /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:61:56: error: expected type-specifier before ‘PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC’
             createPlatformWindowSurface = reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
                                                            ^
    /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:61:56: error: expected ‘>’ before ‘PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC’
    /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:61:56: error: expected ‘(’ before ‘PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC’
    /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:62:68: error: expected ‘)’ before ‘;’ token
                 eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"));
                                                                        ^
    /home/filipe/Qt-Cross-Compile/5.11.1-src/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:65:9: error: ‘createPlatformWindowSurface’ was not declared in this scope
         if (createPlatformWindowSurface) {
             ^
    Makefile:2801: recipe for target '.obj/qeglfskmsgbmwindow.o' failed
    make[7]: *** [.obj/qeglfskmsgbmwindow.o] Error 1
    make[7]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms'
    Makefile:72: recipe for target 'sub-eglfs_kms-make_first' failed
    make[6]: *** [sub-eglfs_kms-make_first] Error 2
    make[6]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/platforms/eglfs/deviceintegration'
    Makefile:104: recipe for target 'sub-deviceintegration-make_first-ordered' failed
    make[5]: *** [sub-deviceintegration-make_first-ordered] Error 2
    make[5]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/platforms/eglfs'
    Makefile:125: recipe for target 'sub-eglfs-make_first' failed
    make[4]: *** [sub-eglfs-make_first] Error 2
    make[4]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins/platforms'
    Makefile:102: recipe for target 'sub-platforms-make_first' failed
    make[3]: *** [sub-platforms-make_first] Error 2
    make[3]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src/plugins'
    Makefile:776: recipe for target 'sub-plugins-make_first' failed
    make[2]: *** [sub-plugins-make_first] Error 2
    make[2]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase/src'
    Makefile:48: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory '/home/filipe/Qt-Cross-Compile/qtbuild/qtbase'
    Makefile:70: recipe for target 'module-qtbase-make_first' failed
    make: *** [module-qtbase-make_first] Error 2
    

    Thanks


  • Moderators

    @dedetuga said in Raspberry Pi 3 B+ cross compile QT5:

    Embarrassing ...

    Don't worry, it's a common error to make.

    Regarding the error - I don't think I've seen this one before, although I vaguely remember something similar. Looks like here somebody has found a solution: https://forum.qt.io/topic/88588/qtbase-compilation-error-with-device-linux-rasp-pi3-g-qeglfskmsgbmwindow-cpp/8

    And this bug report suggests it is fixed in Qt 5.12 https://bugreports.qt.io/browse/QTBUG-68342

    Unfortunately, each time Qt or RPi gets updated, issues pop up :-/



  • @sierdzio

    @sierdzio said in Raspberry Pi 3 B+ cross compile QT5:

    Regarding the error - I don't think I've seen this one before, although I vaguely remember something similar. Looks like here somebody has found a solution: https://forum.qt.io/topic/88588/qtbase-compilation-error-with-device-linux-rasp-pi3-g-qeglfskmsgbmwindow-cpp/8

    I read this one an hour ago when I google the error, and I have 2 replies that pop up to me:

    @ambershark 
    "I finally managed to get it compiled. I know it's not the pretty solution and that this may get back at me sometime, but for now it works.
    I run "make" with 2009 EGL version in place, then i replaced it with 2016 EGL version and run "make" again to compile file that failed. Finally I restored 2009 EGL. "
    

    I have no idea how to play with versions of EGL, I don search it to much too yet.

    @lirik90 
    "When i add this line:
    
    typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
    after all include in file src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp compile was finished great."
    

    Where do I paste this line of code Makefile? which one?

    And this bug report suggests it is fixed in Qt 5.12 https://bugreports.qt.io/browse/QTBUG-68342

    I dont know how to handle bug reports but I will check

    I'm able to find the file libEGL.so and libEGL.so.1.0.0 on my sysroot from my host ubuntu:

    $ find ~/Qt-Cross-Compile/ -type f -name "libEGL*"
    
    /home/filipe/Qt-Cross-Compile/sysroot/opt/vc/lib/libEGL.so
    /home/filipe/Qt-Cross-Compile/sysroot/opt/vc/lib/libEGL_static.a
    /home/filipe/Qt-Cross-Compile/sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0
    
    

    and on my pi:

    pi@raspberrypi:~ $ sudo find /opt/vc/lib/ -type f -name "libEGL*"
    /opt/vc/lib/libEGL_static.a
    /opt/vc/lib/libEGL.so
    

    but now I have no idea what to do.

    However I changed a bit you config file, I read somewhere to try with EGLFS GBM so I changed linux-rasp-pi3-g++ to linux-rasp-pi3-vc4-g++:

    ../$QTVER-src/configure -device linux-rasp-pi3-vc4-g++ -opengl es2 -confirm-license -opensource -release -nomake examples -skip qtwebview -skip qt3d -skip qtquick1 -skip qtwayland -skip qtvirtualkeyboard -skip qtwebchannel -skip qtwebengine -skip qtscript -skip qtscxml -skip qtspeech -skip qtpurchasing -skip qtgamepad -skip qtserialbus -skip qtlocation -no-use-gold-linker -device-option CROSS_COMPILE=~/Qt-Cross-Compile/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/Qt-Cross-Compile/sysroot/ -prefix /home/pi/$QTVER-cross -extprefix ~/Qt-Cross-Compile/$QTVER-cross -hostprefix ~/Qt-Cross-Compile/$QTVER -v
    

    And it compiled fine and installed fine.
    I use rsync -avz 5.11.1-cross pi@raspberrypi.local:/home/pi/5.11.1-cross to send 5.11.1-cross folder to my pi.

    I set up my qt creator following this site, qhen I try to deploy I got:

    22:56:53: Starting /home/pi/untitled2/bin/untitled2 ...
    QXcbConnection: Could not connect to display 
    22:56:54: Remote process crashed.
    

    I add export DISPLAY=:0.0 to .profile file on my pi and reboot, try deploy again and new error:

    23:01:59: Starting /home/pi/untitled2/bin/untitled2 ...
    MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    23:02:13: Application finished with exit code 0.
    

    After some search I found ou this is not an error but a warning, then I look to my VNC window and I have it there, the beautiful window hello world!!!

    I also Found out the breack point dont work, but I think I can do it localy
    Thanks a lot for your help @sierdzio, I have no idea how I do it but It's working


  • Moderators

    Well' I have no idea either, but good that it is working :D Happy coding!



  • After all my journey I decide try help other with this thing of compiling so I create a backup of everything and post it on web, you can download it here
    It's a .rar file with 7.70 GB that contains backup ISO of my Raspberry pi 3B+ And the Cross-Compile folder debated on this topic, everything compiled and installed.

    You need just pass thru some steps to make it work in your Ubuntu (none of this steps are tested, but all the backup is real).

    Cross-Compile setup Instrution:

    On Host PC Ubuntu
    (I used in Ubuntu 16.04LTS I dont know if will work in other version of ubuntu or linux):

    1- Unpack the .rar file to your home directory ~/
    2- Flash the Raspberry Pi Image to your SD card using this command:

    sdd if=~/Raspberry_Pi_3B_Plus_Stretch_backup_15-07-2019_With_Working_QT5-11-1_Cross-Compile.img of=/dev/sdb bs=4M

    Edit the path to the right ones, read more here https://www.htpcguides.com/easy-resize-and-back-up-raspberry-pi-sd-card-with-ubuntu/
    I don't know if your SD card will be sdb it can have another name

    3- Run:

    cd ~/Qt-Cross-Compile/qtbuild/
    make -j nproc install

    4- If no errors, go to your PI

    On your Raspberry Pi 3B+

    1- sudo raspi-config
    2- select "7 Advanced Options" hit enter
    3- select "A1 Expand Filesystem" hit enter
    4- hit enter to "Ok"
    5- select "<Finish>" hit enter
    6- select "<Yes>" to reboot

    You Pi is ready to go

    Follow this link to configure your QTCreator https://wiki.qt.io/RaspberryPi2EGLFS on "Qt Creator" explanation and edit you link to begin with "~/Qt-Cross-Compile..." instead of "~/raspi..."

    Example:

    where say:

    Go to Options -> Compilers
    Add
    GCC
    Compiler path: ~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++

    you edit you path to be:

    ~/Qt-Cross-Compile/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++

    I made this to help other with se same problem I have, read more in:
    https://forum.qt.io/topic/104943/raspberry-pi-3-b-cross-compile-qt5/10



  • Hi. I pretty much cross-compile everything for my many PIs using multiple versions of Qt (although 5.13.0 seems to work rather nicely). I run a Fedora host, although there is no reason this shouldn't work equally as well on any other distro. (If you're running Windoze you're on your own ;)
    It took a bit at first. I have a script at https://github.com/StevePunak/KanoopCommonQt/blob/master/docs/configqt which I use to do my initial configuration.
    Modify the locations at the top to suit your build system, then run this script from your new shadow build location to do your configure
    Three big tips to avoid unnecessary pain are:

    • Never build in source. Always use a shadow directory. Wherever you have the Qt source, make a directory for the build at the same level as Src/, and build there. You can rm -rf the contents of this shadow directory to get a complete clean
    • Before you even start trying to build, fix the symbolic links on your PI directly by using the symlinks utility 'apt-get install symlinks' and running 'sudo symlinks -c .' in /usr/lib/arm-linux-gnueabihf and /etc/alternatives'
    • If possible, DO NOT create a sysroot on your host. Instead use sshfs to mount your PI and use that as your sysroot. That way you will always be in sync when you install new dev packages on your PI. I can not tell you how much time that has saved me!

    Hope this helps a little



  • This post is deleted!

Log in to reply