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. Problem in Deploying and Running Application on Ubuntu.
Forum Updated to NodeBB v4.3 + New Features

Problem in Deploying and Running Application on Ubuntu.

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
32 Posts 3 Posters 8.0k Views 2 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.
  • G Offline
    G Offline
    Girishkuniyal
    wrote on last edited by Girishkuniyal
    #1

    I create a application on ubuntu 16.04 using Qt Based on Qt 5.7.0 and when i run it on my virtual machine ubuntu 14.04 os using soduku-solver.sh script it gives me error.

    • Content of soduku-solver.sh

    #!/bin/sh
    LD_LIBRARY_PATH= pwd/Qt_Libraries
    export LD_LIBRARY_PATH
    ./soduku-solver

    • Error on terminal while running soduku-solver.sh:
      link here or
      alt text

    • Structure of directory:
      link here or
      alt text

    • Files inside Qt_Libraries folder:

    link here or
    alt text

    Help me to deploy this app..for more information project is available here.

    jsulmJ 1 Reply Last reply
    0
    • G Girishkuniyal

      I create a application on ubuntu 16.04 using Qt Based on Qt 5.7.0 and when i run it on my virtual machine ubuntu 14.04 os using soduku-solver.sh script it gives me error.

      • Content of soduku-solver.sh

      #!/bin/sh
      LD_LIBRARY_PATH= pwd/Qt_Libraries
      export LD_LIBRARY_PATH
      ./soduku-solver

      • Error on terminal while running soduku-solver.sh:
        link here or
        alt text

      • Structure of directory:
        link here or
        alt text

      • Files inside Qt_Libraries folder:

      link here or
      alt text

      Help me to deploy this app..for more information project is available here.

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

      @Girishkuniyal Change

      LD_LIBRARY_PATH= pwd/Qt_Libraries
      

      to

      LD_LIBRARY_PATH= $(pwd)/Qt_Libraries
      

      pwd in pwd/Qt_Libraries is not executed as a command! It is just a string. You have to tell the shell to execute pwd and put its output there. You can either use $(COMMAND) or

      `COMMAND`
      

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

      G 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Girishkuniyal Change

        LD_LIBRARY_PATH= pwd/Qt_Libraries
        

        to

        LD_LIBRARY_PATH= $(pwd)/Qt_Libraries
        

        pwd in pwd/Qt_Libraries is not executed as a command! It is just a string. You have to tell the shell to execute pwd and put its output there. You can either use $(COMMAND) or

        `COMMAND`
        
        G Offline
        G Offline
        Girishkuniyal
        wrote on last edited by
        #3

        @jsulm I used $PWD/Qt_Libraries and ./Qt_Libraries too.but error is same.

        jsulmJ 1 Reply Last reply
        0
        • G Girishkuniyal

          @jsulm I used $PWD/Qt_Libraries and ./Qt_Libraries too.but error is same.

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

          @Girishkuniyal Remove the blank after = in:

          LD_LIBRARY_PATH= $PWD/Qt_Libraries
          

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

          1 Reply Last reply
          0
          • G Offline
            G Offline
            Girishkuniyal
            wrote on last edited by Girishkuniyal
            #5

            @jsulm
            Now I got this error
            Segmentation fault (core dumped)

            1 Reply Last reply
            0
            • p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              @Girishkuniyal
              Make sure there is no space after = sign:

              LD_LIBRARY_PATH=$PWD/Qt_Libraries

              Try printing LD_LIBRARY_PATH using echo

              157

              1 Reply Last reply
              0
              • G Offline
                G Offline
                Girishkuniyal
                wrote on last edited by
                #7

                @p3c0 Now it shows the path of Qt_LIbraries
                /home/gman/soduku-solver deploy/Qt_Libraries

                1 Reply Last reply
                0
                • p3c0P Offline
                  p3c0P Offline
                  p3c0
                  Moderators
                  wrote on last edited by
                  #8

                  @Girishkuniyal
                  In your code I see a lots of hardcoded paths. Are you sure those are all present on the deployment machine ?

                  157

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    Girishkuniyal
                    wrote on last edited by Girishkuniyal
                    #9

                    Yes but how to manage this hardcoded path when we are sending my application to another pc. @p3c0

                    1 Reply Last reply
                    0
                    • p3c0P Offline
                      p3c0P Offline
                      p3c0
                      Moderators
                      wrote on last edited by
                      #10

                      @Girishkuniyal If they are just images then put them inside resource files which then automatically gets embedded into your app's binary after compilation.
                      But for now first make sure these paths are not causing the seg fault. I didnt check all the files.

                      157

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        Girishkuniyal
                        wrote on last edited by Girishkuniyal
                        #11

                        can I remove this statements from our code like
                        QPixmap qpic("/home/torrent/build-soduku-solver-Desktop_Qt_5_7_0_GCC_64bit-Debug/images/brain.png");
                        after removing this i could get errors

                        1 Reply Last reply
                        0
                        • p3c0P Offline
                          p3c0P Offline
                          p3c0
                          Moderators
                          wrote on last edited by
                          #12

                          @Girishkuniyal Dont remove that whole line just replace the paths with existing paths present on deployment machine. For eg. you can keep these images inside your deployment folder i.e where your binary is present.

                          157

                          1 Reply Last reply
                          0
                          • G Offline
                            G Offline
                            Girishkuniyal
                            wrote on last edited by Girishkuniyal
                            #13

                            should i create another directory named resources under soduku-solver deploy folder and place all graphic image under it? and gives that path in our code with respect to binary. @p3c0

                            1 Reply Last reply
                            0
                            • p3c0P Offline
                              p3c0P Offline
                              p3c0
                              Moderators
                              wrote on last edited by
                              #14

                              @Girishkuniyal No problem for now. But remember using Qt's Resource system in the future to avoid cross deployment problems.

                              157

                              1 Reply Last reply
                              0
                              • p3c0P Offline
                                p3c0P Offline
                                p3c0
                                Moderators
                                wrote on last edited by
                                #15

                                @Girishkuniyal You could also check using strace to check what files are being opened and that they are found. Try this:
                                strace -e open yourbinary

                                157

                                1 Reply Last reply
                                0
                                • G Offline
                                  G Offline
                                  Girishkuniyal
                                  wrote on last edited by
                                  #16

                                  @p3c0
                                  strace -e open ./soduku-solver.sh output is
                                  link here or
                                  alt text

                                  1 Reply Last reply
                                  0
                                  • p3c0P Offline
                                    p3c0P Offline
                                    p3c0
                                    Moderators
                                    wrote on last edited by
                                    #17

                                    @Girishkuniyal No.. Run it on your binary and not your script. Put that inside your shell script.

                                    157

                                    1 Reply Last reply
                                    0
                                    • G Offline
                                      G Offline
                                      Girishkuniyal
                                      wrote on last edited by Girishkuniyal
                                      #18

                                      Now Output is http://paste.ubuntu.com/23202346/ @p3c0

                                      1 Reply Last reply
                                      0
                                      • p3c0P Offline
                                        p3c0P Offline
                                        p3c0
                                        Moderators
                                        wrote on last edited by p3c0
                                        #19

                                        @Girishkuniyal I had said to put it inside your script because you set LD_LIBRARY_PATH there. Due to this you can see the binary was not able to resolve the Qt library paths.
                                        Anyway if you decide to run it directly make sure you export LD_LIBRARY_PATH on the terminal just before running the strace. This will make sure the library path is set.
                                        Paste that output.
                                        i.e whatever you do inside the script, run that directly on the terminal line by line except the first line #!/bin/sh

                                        157

                                        1 Reply Last reply
                                        0
                                        • G Offline
                                          G Offline
                                          Girishkuniyal
                                          wrote on last edited by
                                          #20

                                          Now The Output is http://paste.ubuntu.com/23202369/

                                          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