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 2 Jan 2022, 19:28 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.

    J D 2 Replies Last reply 2 Jan 2022, 19:40
    0
    • J JoeJoe_000
      2 Jan 2022, 19:28

      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.

      J Offline
      J Offline
      JonB
      wrote on 2 Jan 2022, 19:40 last edited by JonB 1 Feb 2022, 19:40
      #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
        2 Jan 2022, 19:28

        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 3 Jan 2022, 03:37 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.

        J 1 Reply Last reply 3 Jan 2022, 07:56
        0
        • D django.Reinhard
          3 Jan 2022, 03:37

          @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.

          J Offline
          J Offline
          JonB
          wrote on 3 Jan 2022, 07:56 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 3 Jan 2022, 08:57
          0
          • J JonB
            3 Jan 2022, 07:56

            @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 3 Jan 2022, 08:57 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.

            J 1 Reply Last reply 3 Jan 2022, 09:00
            0
            • D django.Reinhard
              3 Jan 2022, 08:57

              @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.

              J Offline
              J Offline
              JonB
              wrote on 3 Jan 2022, 09:00 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 3 Jan 2022, 14:01 last edited by
                #7

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

                J 1 Reply Last reply 3 Jan 2022, 14:06
                0
                • D django.Reinhard
                  3 Jan 2022, 14:01

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

                  J Offline
                  J Offline
                  JonB
                  wrote on 3 Jan 2022, 14:06 last edited by JonB 1 Mar 2022, 14:07
                  #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

                  7/8

                  3 Jan 2022, 14:01

                  • Login

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