Running Qt5 app on embedded platform



  • Hi All,

    For some years I run my QT5 applications on embedded platforms such as the beaglebone. I am only able to run these applications when I install qt5-default on the embedded platform. Without qt5-default the application will not run.

    I have created a little server test program that needs to run on a router that runs debian jessie (EdgeOS) on ARM v7. But I am unable to install qt5-default on this device.

    How can I run my program without installing qt5-default?

    Best regards,
    Without.



  • What is qt5-default?
    I think you can simple copy qt libraries and all should work.



  • qt5-default is a development package which contains all the dependencies to run a QT application.


  • Qt Champions 2016

    @Without

    Unless you static link you app, it's not possible to run without the Qt so/dll files.
    ( static building require a Qt license or that the app is open source)

    So you must build a deployment folder containing these
    http://www.tripleboot.org/?p=138
    Scroll down to linux part.

    also see
    http://doc.qt.io/qt-5/deployment.html



  • @mrjj

    Thank you. That is exactly what I need. For future purposes I will build the QT5 sources for static linking but this will do for now.

    It is not a commercial project. We will use it for a in-house HTTP server.

    Best regards,
    Without.



  • I just build QT5.7 from source for static linking against the QT libs.

    This is the config I use fot static building: ./configure -static -opensource -release -developer-build -prefix /opt/Qt-5.7 -nomake examples -nomake tests

    I thought that the executable would run on a fresh install of Ubuntu without the need of installing external libs but I was wrong.

    Instead there is a huge list of dependencies. Do I have to install these by hand or are these libs part of a package?

    objdump -p TestServer | grep NEEDED
    NEEDED libxcb-glx.so.0
    NEEDED libXi.so.6
    NEEDED libxcb-render-util.so.0
    NEEDED libSM.so.6
    NEEDED libICE.so.6
    NEEDED libxcb-render.so.0
    NEEDED libxcb-image.so.0
    NEEDED libxcb-icccm.so.4
    NEEDED libxcb-sync.so.1
    NEEDED libxcb-xfixes.so.0
    NEEDED libxcb-shm.so.0
    NEEDED libxcb-randr.so.0
    NEEDED libxcb-shape.so.0
    NEEDED libxcb-keysyms.so.1
    NEEDED libxcb-xinerama.so.0
    NEEDED libxcb-xkb.so.1
    NEEDED libxkbcommon-x11.so.0
    NEEDED libxkbcommon.so.0
    NEEDED libjasper.so.1
    NEEDED libtiff.so.5
    NEEDED libwebp.so.5
    NEEDED libwebpdemux.so.1
    NEEDED libgbm.so.1
    NEEDED libdrm.so.2
    NEEDED libX11-xcb.so.1
    NEEDED libxcb.so.1
    NEEDED libX11.so.6
    NEEDED libudev.so.1
    NEEDED libfontconfig.so.1
    NEEDED libfreetype.so.6
    NEEDED libjpeg.so.8
    NEEDED libpng12.so.0
    NEEDED libEGL.so.1
    NEEDED libdbus-1.so.3
    NEEDED libmysqlclient.so.18
    NEEDED libodbc.so.1
    NEEDED libpq.so.5
    NEEDED libsybdb.so.5
    NEEDED libz.so.1
    NEEDED libicui18n.so.52
    NEEDED libicuuc.so.52
    NEEDED libdl.so.2
    NEEDED libglib-2.0.so.0
    NEEDED librt.so.1
    NEEDED libGL.so.1
    NEEDED libpthread.so.0
    NEEDED libstdc++.so.6
    NEEDED libm.so.6
    NEEDED libgcc_s.so.1
    NEEDED libc.so.6
    NEEDED ld-linux.so.2

    Best regards,
    Without.


  • Qt Champions 2016

    Hmm, i expected it to just run also.
    That is what happened in Windows.
    You are 100% sure, you used the static version of qt when compiling?
    I guess yes since no Qt seems listed.
    Also, this is a completely normal Ubuntu you run on ?
    ( not a reduced or special)

    I never tried static in linux so Let's see if we get get some input from others :)


  • Lifetime Qt Champion

    Hi,

    Qt might be build statically that doesn't mean that each of its dependencies are done the same way.

    From what I see, here are the dependencies of the xcb, sql and image plugins.

    If you want a full static application you also have to build against all dependencies built statically.



  • @SGaist

    Ok thank you. I will investigate further.

    Hooray for Microsoft. In visual studio you only have to set the build to static and in release mode and the exe runs on virgin Windows installs. If you want to do the same with QT you are screwed and have to build QT yourself and spend many hours / days trying to figure out why it is not working. Why bother the programmer with such crap.



  • @mrjj

    Yes it is a complete Ubuntu install. If I install qt5-default the program runs fine but with static compiling of QT I thought that I did not need qt5-default anymore. But I was wrong..


  • Lifetime Qt Champion

    No it won't unless you specify that you also want the static runtime to be used which means that you have to follow updates to the runtime because your application won't benefit from new versions of it.

    Most libraries don't use the static runtime. In the end it's the programmers responsibility to choose one or the other mode.

    If you don't want that, then use MinGW in place of VS.



  • I switched to MS MFC instead. Visual studio compiles a static exe when I set the build to static / release and runs fine on Win7, Win8, Win10. I like QT but it bothers me with complicated configuration which is not very well documented and differs from time to time due to different QT and OS versions. And my personal opinion is that you don`t have to bother the application programmer with that.

    Thank you mrjj for your support!

    Best regards,
    Without.


Log in to reply
 

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