Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Making my yocto image able to compile my qt project
Forum Updated to NodeBB v4.3 + New Features

Making my yocto image able to compile my qt project

Scheduled Pinned Locked Moved Solved Mobile and Embedded
yoctoimx8embedded qt
19 Posts 3 Posters 5.3k Views 3 Watching
  • 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.
  • Pablo J. RoginaP Pablo J. Rogina

    @kmarconi said in Making my yocto image able to compile my qt project:

    I would like to know the way to include image files like png or svg in my recipe ?

    I cannot help with Yocto recipes to "bake" those files into the image, but another approach is to add those images into the Qt resource system, making them part of your app executable

    K Offline
    K Offline
    kmarconi
    wrote on last edited by kmarconi
    #9

    @Pablo-J-Rogina I successfully added them to my yocto image, thanks. The thing is that I don't know how to tell my app in the yocto part where to look for these files. In fact, in Qt creator, my app knows that by reading my qrc files and by using "qrc:/...." paths, it will be able to use any kind of files listed in these qrc files. But on the yocto side, I'm not sure that the binary of my app is able to find all these paths. The thing which is telling me this is that I always have this error on my yocto image when i launch the app :

    QQmlCOmponent : Component is not ready
    qml : actionView test for Vid? is null
    QQmlComponent : Component is not ready
    qml : action imageTest for Image is null
    qt.qpa.xcb : xcb_shm_create_segment() failed for size 1228800
    Segmentation fault

    Is there a specific way to tell yocto or qt where to find the files he needs on the yocto side ? Thanks .

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

      Is this coming from your own files ?
      Does your image contain all the QtQuick stuff you are using ?

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

      K 1 Reply Last reply
      0
      • SGaistS SGaist

        Is this coming from your own files ?
        Does your image contain all the QtQuick stuff you are using ?

        K Offline
        K Offline
        kmarconi
        wrote on last edited by kmarconi
        #11

        @SGaist What do you mean by your own files ? If it's about the qml : action error, yes I think it's from my files. In fact, I have an action called imageTest, and it requires a file which is registered in my qrc files and the way to get it is by using the qrc path ("qrc:/myfile.png"). I think that the qml is not able to use this qrc path on the yocto image side and that's why it is saying that the Component is not ready. ( correct me if I'm wrong)

        And about QtQuick, do you have a list of all the qtquick package that we can install ?For the moment, I have included qtquicontrols2 in my recipe with qtquickcontrols2 and qtquickcontrols2-mkspecs in my RDEPENDS flag.

        Thanks again !

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kmarconi
          wrote on last edited by
          #12

          Adding qtquickcontrols2-qmlplugins to my recipe didn't changed anything (don't know if this information matters to you)

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

            No I don't have such a list.

            What I would do is to check that you build all the Qt modules that are related to your QT += entries.

            qrc paths should just work because these files are built in your executable.

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

            K 1 Reply Last reply
            0
            • SGaistS SGaist

              No I don't have such a list.

              What I would do is to check that you build all the Qt modules that are related to your QT += entries.

              qrc paths should just work because these files are built in your executable.

              K Offline
              K Offline
              kmarconi
              wrote on last edited by kmarconi
              #14

              @SGaist Thanks for your support again,will try it out today and then come back here asap

              Edit : I'm using QT += qml quick gui in my .pro, what should I include on the yocto side ? (more than what I actually have in my DEPENDS : qtbase qtdeclarative qtquickcontrols2) . Also, here is my RDEPENDS :
              RDEPENDS_${PN} += "
              qtvirtualkeyboard
              gstreamer1.0-plugins-base
              gstreamer1.0-plugins-good
              qtquickcontrols2
              qtquickcontrols2-mkspecs
              qtquickcontrols2-qmlplugins
              "

              Thanks !

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kmarconi
                wrote on last edited by kmarconi
                #15

                EDIT: Problem is solved, I was missing the qtmultimedia package. Now I have this error (hope to be the last one : QML Image : Cannot open : qrc:/image/test.jpg) whereas I have the qrc file which include this jpg file ...

                EDIT(2) : All my files are now well found by the app, it was a problem of relative path. Now I need to fix the : qt.qpa.xcb : xcb_shm_create_segment() failed for size 1228800 error and it will finally run I wish...

                After running gdb on my apps, it seems to be a problem linked with Qt and OpenGL ( I have the segmentation fault coming from : QOpenGLContext::shareGroup() const () from /usr/lib/libQt5Gui.so.5)

                Pablo J. RoginaP 1 Reply Last reply
                1
                • K kmarconi

                  EDIT: Problem is solved, I was missing the qtmultimedia package. Now I have this error (hope to be the last one : QML Image : Cannot open : qrc:/image/test.jpg) whereas I have the qrc file which include this jpg file ...

                  EDIT(2) : All my files are now well found by the app, it was a problem of relative path. Now I need to fix the : qt.qpa.xcb : xcb_shm_create_segment() failed for size 1228800 error and it will finally run I wish...

                  After running gdb on my apps, it seems to be a problem linked with Qt and OpenGL ( I have the segmentation fault coming from : QOpenGLContext::shareGroup() const () from /usr/lib/libQt5Gui.so.5)

                  Pablo J. RoginaP Offline
                  Pablo J. RoginaP Offline
                  Pablo J. Rogina
                  wrote on last edited by
                  #16

                  @kmarconi said in Making my yocto image able to compile my qt project:

                  QML Image : Cannot open : qrc:/image/test.jpg

                  Could it be possible your yocto image is missing the Qt Image plugins?
                  You should deploy the JPG plugin at least to your device from the <Qt_installation_folder>/plugins/imageformats folder

                  Upvote the answer(s) that helped you solve the issue
                  Use "Topic Tools" button to mark your post as Solved
                  Add screenshots via postimage.org
                  Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kmarconi
                    wrote on last edited by kmarconi
                    #17

                    Hi, thanks for your reply . Yeah I was missing the Qtmultimedia package but also some my path in my qrc files were wrong.

                    I'm now working on the segmentation fault : qt.qpa.xcb : xcb_shm_create_segment() failed for size 1228800 which I have everytime I launch my app ... As I said in my earlier message, after running gdb on my apps, it seems to be a problem linked with Qt and OpenGL ( I have the segmentation fault coming from : QOpenGLContext::shareGroup() const () from /usr/lib/libQt5Gui.so.5)

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

                      Is there anything in your Yocto recipe to manage the OpenGL setup of your device ?

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

                      K 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        Is there anything in your Yocto recipe to manage the OpenGL setup of your device ?

                        K Offline
                        K Offline
                        kmarconi
                        wrote on last edited by kmarconi
                        #19

                        @SGaist I don't think so but in the meantime I don't see any package which could do it. My board support OpenGl ES2 so I tried some stuff like adding "PACKAGE CONFIG += "gles2" " to my qtbase bb file but nothing has changed ...

                        Also tried to add PACKAGECONFIG_append_pn-qtbase = "gles2" in my local.conf but no change.

                        After some googling, I found that the error was printed by this code : https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/xcb/qxcbbackingstore.cpp?h=dev (line 371)

                        Edit: Closing this issue, it was a problem of platform (by default it was using x11 which is not the one used by my embedded device) . Thanks a lot for your help again !

                        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