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. Try to deploy a Subdirs project in Linux.
Forum Updated to NodeBB v4.3 + New Features

Try to deploy a Subdirs project in Linux.

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 1.0k 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.
  • J Offline
    J Offline
    JoeJoe_000
    wrote on last edited by
    #1

    Hello I'm trying to deploy an application in Linux, in Qt Creator I build in release mode and everything looks good. When I attempt to run the application from the terminal or from file manager it won't run. When I run from the terminal I get the message:

    (executable file created in creator) error while loading shared libraries: (dependencies filename) cannot open shared object file: No such file or directory

    when I run an ldd -d on my executable I can see the following:
    lib from core location => not found
    When I attempt to copy this to the same directory there is no effect, and when I attempt to point to the dependencies location I can't seem to change the not found error. Assistance on how to point to the dependencies' location is greatly appreciated.

    JonBJ D 2 Replies Last reply
    0
    • J JoeJoe_000

      Hello I'm trying to deploy an application in Linux, in Qt Creator I build in release mode and everything looks good. When I attempt to run the application from the terminal or from file manager it won't run. When I run from the terminal I get the message:

      (executable file created in creator) error while loading shared libraries: (dependencies filename) cannot open shared object file: No such file or directory

      when I run an ldd -d on my executable I can see the following:
      lib from core location => not found
      When I attempt to copy this to the same directory there is no effect, and when I attempt to point to the dependencies location I can't seem to change the not found error. Assistance on how to point to the dependencies' location is greatly appreciated.

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

      @JoeJoe_000
      To install a Qt application you have written you are supposed to use something like linuxdeployqt. Are you doing so?

      1 Reply Last reply
      0
      • J JoeJoe_000

        Hello I'm trying to deploy an application in Linux, in Qt Creator I build in release mode and everything looks good. When I attempt to run the application from the terminal or from file manager it won't run. When I run from the terminal I get the message:

        (executable file created in creator) error while loading shared libraries: (dependencies filename) cannot open shared object file: No such file or directory

        when I run an ldd -d on my executable I can see the following:
        lib from core location => not found
        When I attempt to copy this to the same directory there is no effect, and when I attempt to point to the dependencies location I can't seem to change the not found error. Assistance on how to point to the dependencies' location is greatly appreciated.

        D Offline
        D Offline
        django.Reinhard
        wrote on last edited by
        #3

        @JoeJoe_000 said in Try to deploy a Subdirs project in Linux.:

        when I run an ldd -d on my executable I can see the following:
        lib from core location => not found

        Your issue is not related to the subdirs type of project.
        On Linux you need to instruct the linker to write the location of the used libs into the executable like this (supposed you use qmake):

        YOUR_LIB = /usr/local
        
        INCLUDEPATH += \
            $${YOUR_LIB}/include
        
        unix::!mac {
            LIBS += -Wl,-rpath=$${YOUR_LIB}/lib
        }
        

        You need to add these lines to the pro-file of the application, not the pro-file of the root directory.

        JonBJ 1 Reply Last reply
        0
        • D django.Reinhard

          @JoeJoe_000 said in Try to deploy a Subdirs project in Linux.:

          when I run an ldd -d on my executable I can see the following:
          lib from core location => not found

          Your issue is not related to the subdirs type of project.
          On Linux you need to instruct the linker to write the location of the used libs into the executable like this (supposed you use qmake):

          YOUR_LIB = /usr/local
          
          INCLUDEPATH += \
              $${YOUR_LIB}/include
          
          unix::!mac {
              LIBS += -Wl,-rpath=$${YOUR_LIB}/lib
          }
          

          You need to add these lines to the pro-file of the application, not the pro-file of the root directory.

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

          @django-Reinhard said in Try to deploy a Subdirs project in Linux.:

          -rpath=$${YOUR_LIB}/lib

          The OP says he is trying to deploy the application, presumably to another machine. Doesn't the above "bake in" a path on the development machine which may not be correct on the deployment machine?

          D 1 Reply Last reply
          0
          • JonBJ JonB

            @django-Reinhard said in Try to deploy a Subdirs project in Linux.:

            -rpath=$${YOUR_LIB}/lib

            The OP says he is trying to deploy the application, presumably to another machine. Doesn't the above "bake in" a path on the development machine which may not be correct on the deployment machine?

            D Offline
            D Offline
            django.Reinhard
            wrote on last edited by
            #5

            @JonB said in Try to deploy a Subdirs project in Linux.:

            Doesn't the above "bake in" a path on the development machine which may not be correct on the deployment machine?

            Sure!

            May be I didn't understand the TO right. I thought he want to call the executable from a different location (possibly on the same machine).
            I had similar problem on my machine, that the shared libs where not found after copying the app to different location.
            With the "right" path baken in, it works like expected.

            JonBJ 1 Reply Last reply
            0
            • D django.Reinhard

              @JonB said in Try to deploy a Subdirs project in Linux.:

              Doesn't the above "bake in" a path on the development machine which may not be correct on the deployment machine?

              Sure!

              May be I didn't understand the TO right. I thought he want to call the executable from a different location (possibly on the same machine).
              I had similar problem on my machine, that the shared libs where not found after copying the app to different location.
              With the "right" path baken in, it works like expected.

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

              @django-Reinhard
              Since the OP talks about "deploying" his Linux app, that is why I asked about linuxdeployqt which is the usual tool to accomplish this, guaranteeing that the target system gets the right libraries in the right places on the new system.

              1 Reply Last reply
              1
              • D Offline
                D Offline
                django.Reinhard
                wrote on last edited by
                #7

                Then i thank you for the clear explanation.
                Possibly I can even use the tool some day

                JonBJ 1 Reply Last reply
                0
                • D django.Reinhard

                  Then i thank you for the clear explanation.
                  Possibly I can even use the tool some day

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

                  @django-Reinhard
                  Fortunately I do not distribute any Qt apps, so I have never used them :) But if I did I would be looking at using linuxdeployqt and windeployqt.

                  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