Compile QT 5.8 to cross-compile Beaglebone



  • Someone can explain me how can I compile Qt 5.8 for Beaglebone with the lasted image (Debian 8.7)?


  • Lifetime Qt Champion

    Hi,

    Please search the forum a bit. There have been several post about that subject in the last months. e.g. this thread



  • @SGaist I've follow the post #13 of mzimmers, but i still cant develop an app using qt creator and qmake.
    I don't know what I am doing bad.
    Can you guide me how to setup?

    regards


  • Lifetime Qt Champion

    What exact error are you getting ?



  • @SGaist I've do the next step based on http://blog.ventisei.eu/

    https://docs.google.com/document/d/1wZSRiB23o-LMRMv039al9q8_ga7I1V7XrCfaT84smkM/edit?usp=sharing

    The error that i get is:
    Creating qmake...
    ........................................................................................Done.
    Info: creating stash file /home/dario/Downloads/qt-everywhere-opensource-src-5.8.0/.qmake.stash
    Info: creating super cache file /home/dario/Downloads/qt-everywhere-opensource-src-5.8.0/.qmake.super

    Running configuration tests...
    Checking for gold linker... no
    Checking for valid makespec...
    ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.

    Check config.log for details.

    The config.log file is here
    https://drive.google.com/file/d/0B4dS_vNgkiYAVVlidlVrTHo1NXM/view?usp=sharing

    Can you help me?


  • Lifetime Qt Champion

    Please add the -v option to have more details about what is happening.

    Also, you should do out of source build, so if something goes wrong you can just nuke the build folder and start anew.



  • Hi, SGaist and Dario -

    I had to rebuild my Linux system from scratch recently, and am just now getting my cross-development tools working with the Beaglebone Black. I think I'm almost there...right now, when I attempt to debug, I get an error message from the target system: "Architecture rejected target-supplied description."

    I've gone over my notes, and it doesn't seem like I encountered this before. The binary I build for the BBB does run (it's just hello world), so I'm wondering if the error message refers to the debugger I'm invoking? SGaist: any suggestions?

    Once I have this working, I'll make an improved write-up of the necessary steps and post it in this thread.


  • Lifetime Qt Champion

    You are maybe using the wrong GDB to connect to your target.



  • Indeed I was. I can now debug hello world, though I am getting this warning when I start:

    Could not load shared library symbols for 7 libraries, e.g. /lib/arm-linux-gnueabihf/librt.so.1.
    Use the "info sharedlibrary" command to see the complete listing.
    Do you need "set solib-search-path" or "set sysroot"?
    

    It didn't affect this particular program, but I'd like to remedy this. Can you please remind me what needs to be done here? As I recall, it's something to do with sysroot, but I can't remember the details.

    Thanks.

    EDIT: I forgot to mention I also get this message at program startup:

    stdin: is not a tty
    

    Is this because I haven't allocated a terminal for the output of the debug session?


  • Lifetime Qt Champion

    I never got that one but I'd check the Kit for the sysroot related stuff.

    That would make sense yes.



  • My BBB kit's sysroot is set to the one I downloaded from Linaro. Is there anything else I need to do? I don't copy it to the BBB, do I?



  • @mzimmers

    Hi! Once you have compiled qt-creator 5.8. did you get .so libraries for BBB?
    A mean libQt5Gui.so.5.8.0, libQt5Serial.so.5.8.0 etc... for BBB debian images.
    what versions of .so libraries are installed now on your beaglebone black board?



  • @Andrey-Shmelew Compiling qt-creator does not give you those libraries. To get them, I believe you need to do a full build of Q for the BBB.



  • Ok!

    Now i have on Windows host machine Qt creator 5.5.0, on BBB i have libraries *.so.5.3.2. How can I be sure that the application will work identiaclly on Windows Host machine and on Linux BeagleBone Board?


  • Moderators

    @Andrey-Shmelew said in Compile QT 5.8 to cross-compile Beaglebone:

    How can I be sure that the application will work identiaclly on Windows Host machine and on Linux BeagleBone Board?

    Do you want to use your app on Windows and BBB?
    To be sure it behaves the same you need to test on both.
    To develop on Windows for BBB you need the Qt libs built for BBB on your Windows machine as well + cross compiler + sysroot.



  • @jsulm said in Compile QT 5.8 to cross-compile Beaglebone:

    Do you want to use your app on Windows and BBB?

    I want to use my application on BBB, but i want it develop and debug on Windows first.
    I plan to develop multithread stable secutiy system based on BBB/Qt/QML. I already have the Qt libs built for BBB on your Windows machine as well + cross compiler + sysroot. But Qt libs was prebuilt. Now i can develop app on Windows and deploy it on BBB, but i am not sure it is the best way.


  • Moderators

    @Andrey-Shmelew said in Compile QT 5.8 to cross-compile Beaglebone:

    but i am not sure it is the best way

    Why not? It is the usual way to develop for other devices. Personally I would prefer Linux as development machine, but it is doable on Windows as well.



  • @jsulm

    You think i should ignore mismatches of libraries versions (*.so.5.3.2 against Qt creator 5.8.0) and keep going?


  • Moderators

    @Andrey-Shmelew There is no QtCreator 5.8 - current version is 4.2.2.
    QtCreator is not the same as Qt. QtCreator is an IDE, Qt is a C++ framework. You can use any Qt version with QtCreator. QtCreator version doesn't matter at all.
    Or do you mean you have Qt 5.8 built for BBB on your Windows machine?



  • @jsulm
    i have
    on Host Windows 10:
    Qt Creator 4.1.0
    Based on Qt 5.7.0 (MSVC 2013, 32 bit)
    Qt Creator has a Kit for BBB

    on Host Windows 10:
    GNU toolchaon for BeagleBone, GCC version 4.9.2 (libs, compiler, gdb debugger, sysroot)



  • @Andrey-Shmelew

    trying to compile Qt 5.8 for BBB.
    Configure script:

    ../qt-everywhere-opensource-src-5.8.0/configure -platform win32-g++ -xplatform linux-arm-gnueabi-g++ -release -device linux-beagleboard-g++ -sysroot C:/SysGCC/Beaglebone/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -device-option CROSS_COMPILE=C:/SysGCC/Beaglebone/bin/arm-linux-gnueabihf- -opensource -confirm-license -v
    

    the output

    Configure summary:
    
    Building on:  arm
    Building for: arm
    Configuration: cross_compile compile_examples enable_new_dtags largefile neon precompile_header shared rpath accessibility release c++11 concurrent dbus no-pkg-config mremap reduce_exports stl
    Build options:
      Mode ................................... release
      Building shared libraries .............. yes
      Using C++ standard ..................... C++11
      Using gold linker ...................... no
      Using new DTAGS ........................ yes
      Using precompiled headers .............. yes
      Using LTCG ............................. no
      Target compiler supports:
        NEON ................................. yes
      Build parts ............................ libs examples
    Qt modules and options:
      Qt Concurrent .......................... yes
      Qt D-Bus ............................... yes
      Qt D-Bus directly linked to libdbus .... no
      Qt Gui ................................. yes
      Qt Widgets ............................. yes
    Support enabled for:
      Accessibility .......................... yes
      Using pkg-config ....................... no
      QML debugging .......................... yes
      udev ................................... no
      Using system zlib ...................... yes
    Qt Core:
      DoubleConversion ....................... yes
        Using system DoubleConversion ........ no
      GLib ................................... no
      iconv .................................. no
      ICU .................................... no
      Logging backends:
        journald ............................. no
        syslog ............................... no
      Using system PCRE ...................... no
    Qt Network:
      getaddrinfo() .......................... no
      getifaddrs() ........................... no
      IPv6 ifname ............................ no
      libproxy ............................... no
      OpenSSL ................................ no
        Qt directly linked to OpenSSL ........ no
      SCTP ................................... no
      Use system proxies ..................... yes
    Qt Sql:
      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 Gui:
      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
      OpenGL:
        EGL .................................. no
        Desktop OpenGL ....................... no
        OpenGL ES 2.0 ........................ no
        OpenGL ES 3.0 ........................ no
        OpenGL ES 3.1 ........................ no
      Session Management ..................... yes
    Features used by QPA backends:
      evdev .................................. no
      libinput ............................... no
      mtdev .................................. no
      tslib .................................. no
      xkbcommon-evdev ........................ no
    QPA backends:
      DirectFB ............................... no
      EGLFS .................................. no
      LinuxFB ................................ no
      Mir client ............................. no
    Qt Widgets:
      GTK+ ................................... no
      Styles ................................. Fusion Windows
    Qt PrintSupport:
      CUPS ................................... no
    Qt SerialBus:
      Socket CAN ............................. no
      Socket CAN FD .......................... no
    QtXmlPatterns:
      XML schema support ..................... yes
    Qt QML:
      QML interpreter ........................ yes
      QML network support .................... yes
    Qt Quick:
      Direct3D 12 ............................ no
      AnimatedImage item ..................... yes
      Canvas item ............................ yes
      Support for Quick Designer ............. yes
      Flipable item .......................... yes
      GridView item .......................... yes
      ListView item .......................... yes
      Path support ........................... yes
      PathView item .......................... yes
      Positioner items ....................... yes
      ShaderEffect item ...................... yes
      Sprite item ............................ yes
    Qt Gamepad:
      SDL2 ................................... no
    Qt 3D:
      System Assimp .......................... no
    Qt Wayland Client ........................ no
    Qt Wayland Compositor .................... no
    Qt Bluetooth:
      BlueZ .................................. no
      BlueZ Low Energy ....................... no
      Linux Crypto API ....................... no
    Qt Multimedia:
      ALSA ................................... no
      GStreamer 1.0 .......................... no
      GStreamer 0.10 ......................... no
      Video for Linux ........................ no
      OpenAL ................................. no
      PulseAudio ............................. no
      Resource Policy (libresourceqt5) ....... no
      DirectShow ............................. no
      Windows Media Foundation ............... no
    Qt Location:
      Gypsy GPS Daemon ....................... no
      WinRT Geolocation API .................. no
    Qt Sensors:
      sensorfw ............................... no
    Qt WebEngine:
      Proprietary Codecs ..................... no
      Spellchecker ........................... yes
      ALSA ................................... no
      PulseAudio ............................. no
    
    Note: QtSerialBus: Cannot find linux/can.h and linux/can/raw.h Linux headers for socketCAN support.
    
    Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
    
    WARNING: No QPA platform plugin enabled! This will
    produce a Qt that cannot run GUI applications.
    The dependencies needed for xcb to build are listed in
    src/plugins/platforms/xcb/README
    
    ERROR: detected a std::atomic implementation that fails for function pointers.
    Please apply the patch corresponding to your Standard Library vendor, found in
      qtbase/config.tests/common/atomicfptr
    
    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.
    

    Have 1 Warning and 2 Errors :( :( :( :( :(
    What do i do wrong? Help!
    (qt 5.5.0 compiled succesfully earlier)



  • This is the command that I used to configure Qt for BBB. Obviously, you'll need to change some pathnames, but it might work better than what you're doing now.

    opt/Qt/5.8/Src/qtbase/configure -platform linux-g++ -xplatform linux-arm-gnueabi-g++ -release -device linux-beagleboard-g++ \
     -sysroot /opt/arm-toolchain/sysroot-glibc-linaro-2.23-2017.02-arm-linux-gnueabihf/ \
     -prefix /opt/QtForBBB/ \
     -device-option CROSS_COMPILE=/opt/arm-toolchain/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- \
     -qt-xcb \
     -nomake tests -nomake examples -no-opengl
    


  • @mzimmers

    ok, i see you are using Linux host machine.
    Where to download linaro toolchain?


  • Moderators



  • @mzimmers
    i Cross Compiled Qt 5.8, so now when i try do deploy, and i've got an errors:

    /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libQt5PrintSupport.so.5: no version information available (required by /usr/test/untitled2)
    /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libQt5Script.so.5: no version information available (required by /usr/test/untitled2)
    /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5: no version information available (required by /usr/test/untitled2)
    /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so.5: no version information available (required by /usr/test/untitled2)
    /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libQt5SerialPort.so.5: no version information available (required by /usr/test/untitled2)
    /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: no version information available (required by /usr/test/untitled2)
    libEGL warning: DRI3: Screen seems not DRI3 capable
    libEGL warning: DRI2: failed to authenticate
    /usr/test/untitled2: relocation error: /usr/test/untitled2: symbol _ZN9QDateTimeC1EOS_, version Qt_5 not defined in file libQt5Core.so.5 with link time reference
    Application finished with exit code 127.
    

    Help...?


  • Moderators

    @Andrey-Shmelew How do you deploy?
    And I guess you get this errors when you try to start your app on the target device, right?
    Do the Qt libraries /usr/lib/arm-linux-gnueabihf/libQt5* have the same version number as the cross compiled Qt (5.8)?
    To me it looks like you're using a different Qt version on the target device.
    See http://doc.qt.io/qt-5/linux-deployment.html for deployment to a Linux system.



  • @jsulm said in Compile QT 5.8 to cross-compile Beaglebone:

    And I guess you get this errors when you try to start your app on the target device, right?

    absolutely!

    Do the Qt libraries /usr/lib/arm-linux-gnueabihf/libQt5* have the same version number as the cross compiled Qt (5.8)?

    No, they have 5.3.2 version number.

    if i replace libQt5SerialPort.so.5 (version 5.3.2) by libQt5SerialPort.so.5 (version 5.8.0); i've got errors:

    /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: no version information available (required by /usr/lib/arm-linux-gnueabihf/libQt5SerialPort.so.5)
    /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: no version information available (required by /usr/lib/arm-linux-gnueabihf/libQt5SerialPort.so.5)
    /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/arm-linux-gnueabihf/libQt5SerialPort.so.5)
    

  • Moderators

    @Andrey-Shmelew If you replace then replace all used libraries not just one of them!
    And actually you should NOT replace system libraries as other applications could depend on them!
    Instead deploy your app together with needed libraries as described in the link I posted before.



  • @jsulm

    thanks for the link.

    probably i should paste all of needed libraries to separate folder (for example "/usr/lib/my5-8libs")

    and then somehow to link my application to these libraries?


  • Moderators

    @Andrey-Shmelew You can put the libs into a separate folder, but you should use /usr/local/lib/... not /usr/lib
    But then you either need to tell the system where to find them using LD_LIBRARY_PATH (described in the link I posted), or use RPATH to set the path to the libs in your executable, see https://en.wikipedia.org/wiki/Rpath
    Using /usr/local/lib probably does not require LD_LIBRARY_PATH nor RPATH, but any other locations not searched by the OS by default do.



  • what 's the problem might be here when i start an application:

    This application failed to start because it could not find or load the Qt platform plugin "xcb"
    in "".
    
    Reinstalling the application may fix this problem.
    Aborted
    

    it came when i uploaded new libraries 5.8.0 to /usr/lib/new5dot8libs/
    and entered commands:

    LD_LIBRARY_PATH=/usr/lib/new5dot8libs
    export LD_LIBRARY_PATH
    


  • @Andrey-Shmelew something is not right with your path variable. I notice that your command is overwriting (rather than adding to) any existing LD_LIBRARY_PATH variable; is this intentional? One of these methods is more conventional:

    PATH=$PATH:/new/path
    PATH=/new/path:$PATH
    

    Also, did you put this command in a startup script? I'm not sure the export will survive a system restart.



  • hi! i have absolutely the same trouble:
    i reproduse it with absolutely minimal qml example
    When i deploy qt 5.5 application on beaglebone device (arm linux gnueabihf) - then works perfectly
    When i deploy qt 5.8 - the error appears:

    QQmlApplicationEngine failed to load component
    qrc:/main.qml:-1 File not found
    

    // this somehow works but the window is blank
    main.cpp:

    #include <QGuiApplication>
    #include <QQuickView>
    
    int main(int argc, char *argv[])
    {
        QGuiApplication app(argc, argv);
    
        QQuickView view;
        view.setSource(QUrl::fromLocalFile("main.qml"));
        view.show();
    
        return app.exec();
    }
    

  • Moderators

    @Andrey-Shmelew You're using a relative path:

    view.setSource(QUrl::fromLocalFile("main.qml"));
    

    Depending from where you start your app the file will not be found.
    You should construct an absolute path at runtime using http://doc.qt.io/qt-5/qcoreapplication.html#applicationDirPath



  • @jsulm
    um, should i make something like this?

        QQuickView view;
        view.setSource(QUrl::fromLocalFile("C:/qtqml57/main.qml"));
        view.show();
    

    the output is still

    file:///C:/qtqml57/main.qml: File not found
    

  • Lifetime Qt Champion

    Because that file is located on your Windows machine.

    If you don't want to put it in a Qt resource, then do as @jsulm suggested: build the path at run time.


  • Moderators

    @Andrey-Shmelew Something like this:

    QString path = QCoreApplication::applicationDirPath() + '/' + "main.qml";
    QQuickView view;
    view.setSource(QUrl::fromLocalFile(path));
    view.show();
    


  • @jsulm
    thanks, but it don't works for me

    file:///usr/main.qml: File not found
    

    note that when i deploy with qt 5.5 kit it enables to deploy without any path stuff

    so if i upload main.qml to beaglebone's /usr/ folder then i get :

    QQuickView only supports loading of root objects that derive from QQuickItem. 
    
    If your example is using QML 2, (such as qmlscene) and the .qml file you 
    loaded has 'import QtQuick 1.0' or 'import Qt 4.7', this error will occur. 
    
    To load files with 'import QtQuick 1.0' or 'import Qt 4.7', use the 
    QDeclarativeView class in the Qt Quick 1 module.
    

  • Moderators

    @Andrey-Shmelew "/usr"?!
    Where is you app located?



  • @jsulm
    it is located in beaglebone's /usr folder when deployed.

    When i develop -main.qml is located on windows C:/qtqml57/main.qml ( qtqml57 is qt 5 project folder)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.