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. Qt Linux Deployment
Forum Updated to NodeBB v4.3 + New Features

Qt Linux Deployment

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 4 Posters 4.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.
  • S Offline
    S Offline
    shahriar25
    wrote on last edited by
    #1

    Hi
    I was reading the qt document on deplying on linux and looking for the easiest and cross distro way and I found this: creating a .sh file and putting the executable and libraries in a folder:

    #!/bin/sh
    appname=basename $0 | sed s,\.sh$,,

    dirname=dirname $0
    tmp="${dirname#?}"

    if [ "${dirname%$tmp}" != "/" ]; then
    dirname=$PWD/$dirname
    fi
    LD_LIBRARY_PATH=$dirname
    export LD_LIBRARY_PATH
    $dirname/$appname "$@"

    this was in the document. my question is what to change here so I can have my own .sh file for my application? what parts sould I modify?

    JKSHJ 1 Reply Last reply
    0
    • S shahriar25

      Hi
      I was reading the qt document on deplying on linux and looking for the easiest and cross distro way and I found this: creating a .sh file and putting the executable and libraries in a folder:

      #!/bin/sh
      appname=basename $0 | sed s,\.sh$,,

      dirname=dirname $0
      tmp="${dirname#?}"

      if [ "${dirname%$tmp}" != "/" ]; then
      dirname=$PWD/$dirname
      fi
      LD_LIBRARY_PATH=$dirname
      export LD_LIBRARY_PATH
      $dirname/$appname "$@"

      this was in the document. my question is what to change here so I can have my own .sh file for my application? what parts sould I modify?

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

      Hi @shahriar25,

      You don't need to modify the script. You just need to make sure that the script file has the same name as your executable, and put them in the same directory. For example, if your executable is called MyApp, your script file must be called MyApp.sh.

      Note: Personally, I recommend setting rpath instead of using a launcher script. The method is very simple: Simply add the line,QMAKE_LFLAGS += -Wl,-rpath,"'\$$ORIGIN'" to your .pro file. See this blog for full details: http://www.tripleboot.org/?p=138

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

      1 Reply Last reply
      1
      • S Offline
        S Offline
        shahriar25
        wrote on last edited by
        #3

        Hi @JKSH
        Thank you for helping. I will try this way and ask here if I had a problem

        1 Reply Last reply
        0
        • S Offline
          S Offline
          shahriar25
          wrote on last edited by
          #4

          Hi @JKSH
          I wanted to try your way but I couldn't find the libqxcb.so. I mean it is in: path/to/qt/plugins/platforms but it's size is 10 KB!!! and the apps won't run without it. what should I do?

          K 1 Reply Last reply
          0
          • S shahriar25

            Hi @JKSH
            I wanted to try your way but I couldn't find the libqxcb.so. I mean it is in: path/to/qt/plugins/platforms but it's size is 10 KB!!! and the apps won't run without it. what should I do?

            K Offline
            K Offline
            KeithS
            wrote on last edited by
            #5

            @shahriar25

            Did you read the tripleboot.org blog? That describes how to deploy Qt apps and in particular how to deploy the Qt plugins such as libqxcb.so.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              shahriar25
              wrote on last edited by
              #6

              Hi @KeithS
              my problem is that my libqxcb.so is 10 KB instead of 1.3 MB ! I have installed Qt with the .run file to the default path. what am I doing wrong?

              K JKSHJ 2 Replies Last reply
              0
              • S shahriar25

                Hi @KeithS
                my problem is that my libqxcb.so is 10 KB instead of 1.3 MB ! I have installed Qt with the .run file to the default path. what am I doing wrong?

                K Offline
                K Offline
                KeithS
                wrote on last edited by
                #7

                @shahriar25

                That sounds about right:

                -rwxr-xr-x 1 root root 10752 Feb 25 09:39 libqxcb.so

                1 Reply Last reply
                0
                • S shahriar25

                  Hi @KeithS
                  my problem is that my libqxcb.so is 10 KB instead of 1.3 MB ! I have installed Qt with the .run file to the default path. what am I doing wrong?

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

                  @shahriar25 said:

                  my problem is that my libqxcb.so is 10 KB instead of 1.3 MB !

                  That's not a problem.

                  libqxcb.so was 1.3 MB in Qt 5.3, but reduced to 10 KB in Qt 5.5.

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

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    shahriar25
                    wrote on last edited by
                    #9

                    Hi @JKSH @KeithS thank you both
                    It worked you were right I had the right file. but how ever I got another problem when I ran the executable from terminal:

                    cannot mix incompatible Qt library ( version 0x50500 ) with this library ( version 0x50501 )

                    what is this problem? how do I fix it? thanks in advance

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

                      Hi,

                      Do you have 5.5.1 installed on your system ? What distribution are you using ?

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

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        shahriar25
                        wrote on last edited by shahriar25
                        #11

                        Hi @SGaist
                        well I do have 5.5.1 installed on my fedora but I wanted to test deploying qt programs with shared library so I tested it on a live fedora with gnome.
                        the thing is that I don't have qt 5.5 anywhere I only have 5.5.1 and 5.6 beta!

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

                          What version does the live fedora provide ?

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

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            shahriar25
                            wrote on last edited by
                            #13

                            well the qt is not installed on it and it is fedora 23 with gnome UI

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

                              Are you sure Qt's not installed on it ? I don't mean the development environment but I'd be surprised that the libraries are not there at all.

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

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                shahriar25
                                wrote on last edited by
                                #15

                                Hi @SGaist
                                Well I'm sure the qt IDE is not installed and also it's a live fedora I haven't installed it so it is the pure fedora. I don't know if qt libs are installed on it or not

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

                                  Then run ldd your_application_name on that version of Fedora. You'll see if you have Qt available.

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

                                  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