Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Moving program to other system
Forum Updated to NodeBB v4.3 + New Features

Moving program to other system

Scheduled Pinned Locked Moved Unsolved General and Desktop
15 Posts 6 Posters 3.1k 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 Offline
    Pablo J. RoginaP Offline
    Pablo J. Rogina
    wrote on last edited by
    #3

    @column given the size/complexity of your application, you may want to take a look at linuxdeployqt tool.

    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
    2
    • jsulmJ jsulm

      @column Take a look at http://doc.qt.io/qt-5/linux-deployment.html
      You need copy needed Qt libraries together with your app, or if the Linux distribution is exactly the same install needed Qt libraries (you don't need qt-devel if you don't plan to build Qt apps on that machine).

      C Offline
      C Offline
      column
      wrote on last edited by
      #4

      @jsulm
      In article you provided I found I can link my binary statically. In this case I will not need any libraries at all. It sound good, but I can't find ./configure executable in my system needed in command below:

      cd /path/to/Qt
      ./configure -static -prefix /path/to/Qt <other parameters>
      make
      
      jsulmJ 1 Reply Last reply
      0
      • C column

        @jsulm
        In article you provided I found I can link my binary statically. In this case I will not need any libraries at all. It sound good, but I can't find ./configure executable in my system needed in command below:

        cd /path/to/Qt
        ./configure -static -prefix /path/to/Qt <other parameters>
        make
        
        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by jsulm
        #5

        @column You need Qt source code.
        Keep in mind that compiling Qt isn't an easy task. It is easier to deploy your app together with needed libraries as described in the link.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #6

          @column another approach could be trial and error, not the most efficient but effective in the end. So far you have this error in the "fresh CentOS 32 system that has no QT installed"

          :error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory

          You need to copy that file libQt5Widgets.so.5 in the same folder of your executable, or in some folder in the library path. And you keep trying, running the executable and if you got an error, copying the referred library file until you got all the required files in your fresh machine

          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

          C 1 Reply Last reply
          1
          • Pablo J. RoginaP Pablo J. Rogina

            @column another approach could be trial and error, not the most efficient but effective in the end. So far you have this error in the "fresh CentOS 32 system that has no QT installed"

            :error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory

            You need to copy that file libQt5Widgets.so.5 in the same folder of your executable, or in some folder in the library path. And you keep trying, running the executable and if you got an error, copying the referred library file until you got all the required files in your fresh machine

            C Offline
            C Offline
            column
            wrote on last edited by
            #7

            @Pablo-J.-Rogina
            I placed libQt5Widgets.so.5 file near executable, but I still have error :

            : error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
            

            I suppose I should somehow set path to library?

            JonBJ jsulmJ 2 Replies Last reply
            0
            • C column

              @Pablo-J.-Rogina
              I placed libQt5Widgets.so.5 file near executable, but I still have error :

              : error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
              

              I suppose I should somehow set path to library?

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #8

              @column

              I assume "near executable" means in same folder, right?

              One of the things I think i have noticed under Linux is that if you try to load a shared library and that library has other dependent file libraries it requires, then (I think) you tend to get the error message "no such file or directory" on the original library, when in fact it's a dependent library which is missing.

              Run a ldd libQt5Widgets.so.5 on the library. This will list out the dependents it also requires. Are there perchance other files which are missing in that list?

              C 1 Reply Last reply
              1
              • C column

                @Pablo-J.-Rogina
                I placed libQt5Widgets.so.5 file near executable, but I still have error :

                : error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
                

                I suppose I should somehow set path to library?

                jsulmJ Online
                jsulmJ Online
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #9

                @column said in Moving program to other system:

                I placed libQt5Widgets.so.5

                From where did you take it? You should not take it from QtCreator directory, but from the Qt setup you used to build your app.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                C 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @column said in Moving program to other system:

                  I placed libQt5Widgets.so.5

                  From where did you take it? You should not take it from QtCreator directory, but from the Qt setup you used to build your app.

                  C Offline
                  C Offline
                  column
                  wrote on last edited by
                  #10

                  @jsulm
                  I found two files of libQt5Widgets.so.5 :

                  ./opt/Qt/Tools/QtCreator/lib/qtcreator/libQt5Widgets.so.5
                  ./opt/Qt/5.5/gcc/lib/libQt5Widgets.so.5

                  I build and run my application from QT Creator. What do you mean "QT setup"?

                  jsulmJ 1 Reply Last reply
                  0
                  • JonBJ JonB

                    @column

                    I assume "near executable" means in same folder, right?

                    One of the things I think i have noticed under Linux is that if you try to load a shared library and that library has other dependent file libraries it requires, then (I think) you tend to get the error message "no such file or directory" on the original library, when in fact it's a dependent library which is missing.

                    Run a ldd libQt5Widgets.so.5 on the library. This will list out the dependents it also requires. Are there perchance other files which are missing in that list?

                    C Offline
                    C Offline
                    column
                    wrote on last edited by
                    #11

                    @JonB

                    I copyed missing libs:

                    -rwxr-xr-x.  1 g g 25336904 Mar  5 08:11 libicudata.so.54
                    -rwxr-xr-x.  1 g g  3152461 Mar  5 08:10 libicui18n.so.54
                    -rwxr-xr-x.  1 g g  1949914 Mar  5 08:10 libicuuc.so.54
                    -rwxr-xr-x.  1 g g  5527300 Mar  5 08:08 libQt5Core.so.5
                    -rwxr-xr-x.  1 g g  7011644 Mar  5 08:07 libQt5Gui.so.5
                    -rwxr-xr-x.  1 g g  7576944 Mar  5 06:39 libQt5Widgets.so.5
                    

                    and now ldd looks:

                    ldd libQt5Widgets.so.5
                       linux-gate.so.1 =>  (0x0029b000)
                       libQt5Gui.so.5 => /home/g/rewe/./libQt5Gui.so.5 (0x017c8000)
                       libQt5Core.so.5 => /home/g/rewe/./libQt5Core.so.5 (0x0029c000)
                       libpthread.so.0 => /lib/libpthread.so.0 (0x0019c000)
                       libgobject-2.0.so.0 => /lib/libgobject-2.0.so.0 (0x001b7000)
                       libgthread-2.0.so.0 => /lib/libgthread-2.0.so.0 (0x00204000)
                       librt.so.1 => /lib/librt.so.1 (0x00209000)
                       libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x007e5000)
                       libXext.so.6 => /usr/lib/libXext.so.6 (0x00212000)
                       libX11.so.6 => /usr/lib/libX11.so.6 (0x048fd000)
                       libGL.so.1 => /usr/lib/libGL.so.1 (0x038cd000)
                       libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x031cc000)
                       libm.so.6 => /lib/libm.so.6 (0x00224000)
                       libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0024e000)
                       libc.so.6 => /lib/libc.so.6 (0x01097000)
                       libicui18n.so.54 => /home/g/rewe/./libicui18n.so.54 (0x03d84000)
                       libicuuc.so.54 => /home/g/rewe/./libicuuc.so.54 (0x03353000)
                       libicudata.so.54 => /home/g/rewe/./libicudata.so.54 (0xb5ee3000)
                       libdl.so.2 => /lib/libdl.so.2 (0x0026c000)
                       /lib/ld-linux.so.2 (0x0093b000)
                       libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00271000)
                       libglapi.so.0 => /usr/lib/libglapi.so.0 (0x0122e000)
                       libselinux.so.1 => /lib/libselinux.so.1 (0x00902000)
                       libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00921000)
                       libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00924000)
                       libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0x00299000)
                       libxcb-glx.so.0 => /usr/lib/libxcb-glx.so.0 (0x05289000)
                       libxcb-dri2.so.0 => /usr/lib/libxcb-dri2.so.0 (0x00929000)
                       libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x0092e000)
                       libdrm.so.2 => /usr/lib/libdrm.so.2 (0x06c17000)
                       libexpat.so.1 => /lib/libexpat.so.1 (0x0127b000)
                       libXau.so.6 => /usr/lib/libXau.so.6 (0x00933000)
                    
                    
                    

                    but still have rror while executing binary :

                    error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
                    
                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #12

                      Hi,

                      You also need to alter the LD_LIBRARY_PATH environment variable to make it look in the current folder.

                      As @Pablo-J-Rogina already suggested, you should really take a look at the linuxdeployqt project, it provides a really nice tool to deploy Qt applications.

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

                      C 1 Reply Last reply
                      1
                      • C column

                        @jsulm
                        I found two files of libQt5Widgets.so.5 :

                        ./opt/Qt/Tools/QtCreator/lib/qtcreator/libQt5Widgets.so.5
                        ./opt/Qt/5.5/gcc/lib/libQt5Widgets.so.5

                        I build and run my application from QT Creator. What do you mean "QT setup"?

                        jsulmJ Online
                        jsulmJ Online
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #13

                        @column said in Moving program to other system:

                        What do you mean "QT setup"?

                        I mean your Qt installation.
                        The correct one is ./opt/Qt/5.5/gcc/lib/libQt5Widgets.so.5, not the one from QtCreator.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • SGaistS SGaist

                          Hi,

                          You also need to alter the LD_LIBRARY_PATH environment variable to make it look in the current folder.

                          As @Pablo-J-Rogina already suggested, you should really take a look at the linuxdeployqt project, it provides a really nice tool to deploy Qt applications.

                          C Offline
                          C Offline
                          column
                          wrote on last edited by
                          #14

                          @SGaist
                          After setting LD_LIBRARY_PATH I got error after executing binary:

                          This application failed to start because it could not find or load the Qt platform plugin "xcb".
                          

                          How to fix this problem?

                          JKSHJ 1 Reply Last reply
                          0
                          • C column

                            @SGaist
                            After setting LD_LIBRARY_PATH I got error after executing binary:

                            This application failed to start because it could not find or load the Qt platform plugin "xcb".
                            

                            How to fix this problem?

                            JKSHJ Offline
                            JKSHJ Offline
                            JKSH
                            Moderators
                            wrote on last edited by
                            #15

                            @column said in Moving program to other system:

                            This application failed to start because it could not find or load the Qt platform plugin "xcb".
                            

                            How to fix this problem?

                            Add platforms/libqxcb.so to your application directory. The platforms folder must be on the same level as libQt5Core.so.5, and libqxcb.so must be inside platforms.

                            Or, use linuxdeployqt, as @Pablo-J-Rogina and @SGaist have suggested to you.

                            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                            1 Reply Last reply
                            2

                            • Login

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