Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Cannot deploy to Linux system whatsoever
QtWS25 Last Chance

Cannot deploy to Linux system whatsoever

Scheduled Pinned Locked Moved Installation and Deployment
11 Posts 3 Posters 3.4k Views
  • 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.
  • A Offline
    A Offline
    adutzu89
    wrote on last edited by adutzu89
    #1

    I have tried making a distributable application with no avail on Linux, can someone please assist me?
    I read the deployment for Linux/X11 all week and looked through the internet for solutions.
    I first tried with qt.conf:

    • I have put it inside the executable file
    • I have put it inside qrc:/qt/etc/qt.conf
      Both not working at all, the first mentioned it was like it wasn't even present, and the second it wouldn't find the path(from what I have seen)

    I have tried then using rpath:

    • when I put this path, the executable file could find the libraries but libqxcb.so couldn't

    I finally resorted to using LD_LIBRARY_PATH:

    • I set the path to libraries but then the executable crashes with: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
    kshegunovK 1 Reply Last reply
    0
    • A adutzu89

      I have tried making a distributable application with no avail on Linux, can someone please assist me?
      I read the deployment for Linux/X11 all week and looked through the internet for solutions.
      I first tried with qt.conf:

      • I have put it inside the executable file
      • I have put it inside qrc:/qt/etc/qt.conf
        Both not working at all, the first mentioned it was like it wasn't even present, and the second it wouldn't find the path(from what I have seen)

      I have tried then using rpath:

      • when I put this path, the executable file could find the libraries but libqxcb.so couldn't

      I finally resorted to using LD_LIBRARY_PATH:

      • I set the path to libraries but then the executable crashes with: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @adutzu89 said in Cannot deploy to Linux system whatsoever:

      Both not working at all, the first mentioned it was like it wasn't even present, and the second it wouldn't find the path(from what I have seen)

      qt.conf goes in the directory where the application is located, it doesn't go into qrc, or into the binary.

      when I put this path, the executable file could find the libraries but libqxcb.so couldn't

      If you haven't modified the rpath for the said shared object, then it's small wonder it won't find the libraries.

      I set the path to libraries but then the executable crashes with: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

      That sounds like libqxcb.so can't find libxcb.so or the OGL libraries. Try tracing the dependencies, e.g:

      LD_LIBRARY_PATH=/path/you/set/when/running/app:$LD_LIBRARY_PATH ldd /path/to/libqxcb.so
      

      Then check if the link paths are pointing to valid libraries.

      Kind regards.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      1
      • A Offline
        A Offline
        adutzu89
        wrote on last edited by
        #3

        Thank you for taking your time to help.

        qt.conf goes in the directory where the application is located, it doesn't go into qrc, or into the binary.

        According to the documentation in "using qt.conf":

        QLibraryInfo will load qt.conf from one of the following locations:
        :/qt/etc/qt.conf using the resource system

        and in Qt resource system:

        The Qt resource system is a platform-independent mechanism for storing binary files in the application's executable.

        My understanding is that any files add in the resource system end up in final binary file(executable file), correct me if I am wrong?

        If you haven't modified the rpath for the said shared object, then it's small wonder it won't find the libraries.

        I want to avoid such thing if I don't need it so I haven't changed rpath of anything but my application and now it's removed even from application .pro file.

        Then check if the link paths are pointing to valid libraries.

        I have run ldd on several libraries(and ofc my binary) including libqxcb.so and all dependencies are met.

        kshegunovK 1 Reply Last reply
        0
        • A adutzu89

          Thank you for taking your time to help.

          qt.conf goes in the directory where the application is located, it doesn't go into qrc, or into the binary.

          According to the documentation in "using qt.conf":

          QLibraryInfo will load qt.conf from one of the following locations:
          :/qt/etc/qt.conf using the resource system

          and in Qt resource system:

          The Qt resource system is a platform-independent mechanism for storing binary files in the application's executable.

          My understanding is that any files add in the resource system end up in final binary file(executable file), correct me if I am wrong?

          If you haven't modified the rpath for the said shared object, then it's small wonder it won't find the libraries.

          I want to avoid such thing if I don't need it so I haven't changed rpath of anything but my application and now it's removed even from application .pro file.

          Then check if the link paths are pointing to valid libraries.

          I have run ldd on several libraries(and ofc my binary) including libqxcb.so and all dependencies are met.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          @adutzu89 said in Cannot deploy to Linux system whatsoever:

          According to the documentation in "using qt.conf":

          QLibraryInfo will load qt.conf from one of the following locations:
          :/qt/etc/qt.conf using the resource system

          Yes, apparently it does, my bad, sorry.

          My understanding is that any files add in the resource system end up in final binary file(executable file), correct me if I am wrong?

          No, not always, but usually (by default) it ends up in the binary.

          I want to avoid such thing if I don't need it so I haven't changed rpath of anything but my application and now it's removed even from application .pro file.
          I have run ldd on several libraries(and ofc my binary) including libqxcb.so and all dependencies are met.

          I still think the qt.conf file is your best bet then. Usually it's a trivial (but not trivial to find) problem with the paths. Can you provide you project structure and the qt.conf file you had used?

          Read and abide by the Qt Code of Conduct

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

            Hi,

            You can also take a look at the linuxdeployqt which aims to assist in Linux application deployment.

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

            A 1 Reply Last reply
            1
            • SGaistS SGaist

              Hi,

              You can also take a look at the linuxdeployqt which aims to assist in Linux application deployment.

              A Offline
              A Offline
              adutzu89
              wrote on last edited by adutzu89
              #6

              @SGaist it doesn' work, but am looking into the source code to see what's copying in the directory tree.

              @kshegunov I will try again with qt.conf, I will put a directory tree after I finish it.

              1 Reply Last reply
              0
              • kshegunovK kshegunov

                @adutzu89 said in Cannot deploy to Linux system whatsoever:

                According to the documentation in "using qt.conf":

                QLibraryInfo will load qt.conf from one of the following locations:
                :/qt/etc/qt.conf using the resource system

                Yes, apparently it does, my bad, sorry.

                My understanding is that any files add in the resource system end up in final binary file(executable file), correct me if I am wrong?

                No, not always, but usually (by default) it ends up in the binary.

                I want to avoid such thing if I don't need it so I haven't changed rpath of anything but my application and now it's removed even from application .pro file.
                I have run ldd on several libraries(and ofc my binary) including libqxcb.so and all dependencies are met.

                I still think the qt.conf file is your best bet then. Usually it's a trivial (but not trivial to find) problem with the paths. Can you provide you project structure and the qt.conf file you had used?

                A Offline
                A Offline
                adutzu89
                wrote on last edited by
                #7

                @kshegunov said in Cannot deploy to Linux system whatsoever:

                I still think the qt.conf file is your best bet then. Usually it's a trivial (but not trivial to find) problem with the paths. Can you provide you project structure and the qt.conf file you had used?

                Ok so here is my directory structure:
                lib
                plugins

                • plugins/bearer
                  plugins/libexec
                  plugins/platforms
                  plugins/resources

                qml

                • qml/QtQuick
                  qml/QtQuick.2
                  qml/QtWebView

                <binary-file>
                qt.conf

                Content of qt.conf:
                [Paths]
                Libraries = lib
                Plugins = plugins
                Qml2Imports = qml

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  adutzu89
                  wrote on last edited by adutzu89
                  #8

                  The issue was solved after putting the xcbglintegrations plugin, don't know I remember previously trying that and didn't worked, ah well now it it goes past that

                  Now I get other issues:

                  Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
                  QQmlComponent: Component is not ready
                  QObject::connect: invalid null parameter
                  QObject::connect: invalid null parameter
                  QObject::connect: invalid null parameter
                  QObject::connect: invalid null parameter

                  And besides that the binary still doesn't takes qt.conf paths to search.

                  kshegunovK 1 Reply Last reply
                  0
                  • A adutzu89

                    The issue was solved after putting the xcbglintegrations plugin, don't know I remember previously trying that and didn't worked, ah well now it it goes past that

                    Now I get other issues:

                    Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
                    QQmlComponent: Component is not ready
                    QObject::connect: invalid null parameter
                    QObject::connect: invalid null parameter
                    QObject::connect: invalid null parameter
                    QObject::connect: invalid null parameter

                    And besides that the binary still doesn't takes qt.conf paths to search.

                    kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by kshegunov
                    #9

                    Perhaps you can check from the application (after you create the application object) a few of the paths, this might hint if your qt.conf's been loaded. E.g.:

                    qDebug() << QLibraryInfo::location(QLibraryInfo::PluginsPath); // Should give you the plugin loading path
                    

                    PS. If it's able to load the xcb integration, then I'd assume the paths are working okay. It might be a plugin dependency problem ...

                    Read and abide by the Qt Code of Conduct

                    1 Reply Last reply
                    1
                    • A Offline
                      A Offline
                      adutzu89
                      wrote on last edited by adutzu89
                      #10

                      Apparently the issue is my machine on which I target, a Xubuntu 16.04, but on my main laptop which is powered by an Uubuntu 16.04 qt.conf seems to work.
                      Even tough previously it didn't, when I was searching for qt.conf with: qDebug() << "qt.conf " << QDir(QCoreApplication::applicationDirPath()).exists("qt.conf‌​"); it returned false but the file was in the same directory as the binary file.(it might have been because of different options changes to my .pro file(who knows, I don't remember what modifications I had to it then).
                      After seeing that qt.conf forces my application to search for deployment files in my specified locations I decided to deploy it again on my Xubuntu virtual machine, but it didn't used the qt.conf file until I have exported LD_LIBRARY_PATH.....I'm assuming this behaviour isn't normal and should be related to the OS.

                      The last error I mentioned, "Qt: Session management error:....", seems to be because I haven't deployed QtWebEngine qml module ( I was deploying only QtWebView ).

                      I will try this evening after work -rpath and qt.conf to see if it starts without issues.

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        adutzu89
                        wrote on last edited by
                        #11

                        So apparently qt.conf doesn't always work for loading libraries.
                        If I use rpath and qt.conf for setting the rest of the path it works, If I use qt.conf alone it doesn't.

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved