Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Deploying my application with my own library is failed.
Forum Updated to NodeBB v4.3 + New Features

Deploying my application with my own library is failed.

Scheduled Pinned Locked Moved Solved Qt 6
7 Posts 3 Posters 707 Views 1 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.
  • W Offline
    W Offline
    Wunian
    wrote on last edited by
    #1

    Hi,
    My environment is below,
    Mac mini, MacOS M1 64bit, Sonoma 14.2.1
    XCode: 15.2

    I use Qt 6.5.3, and set target path as below,
    unix {
    target.path = /usr/local/lib
    }

    and create my own library, and build it in my release-build folder.

    Next, I copy my library(libMymac.1.0.0.dylib) to /usr/local/lib,
    and create symbolic-link files in the same path as below,
    libMymac.dylib
    libMymac.1.dylib
    libMymac.1.0.dylib

    I also create an application (Mymacapp), and load my own library in the pro file as below,
    LIBS += -L$$PWD/Mymac/ -lMymac.1.0.0
    and build my application, and it works fine.

    Now, I try to deploy my application like this,
    ./macdeployqt Mymacapp.app

    it complains <ERROR: no file at "/usr/lib/libMymac.1.dylib">.

    Here my question is, I set target.path = /usr/local/lib,
    why I get the error path /usr/lib ??

    May I know how I can solve this issue?
    Thanks.
    Have a nice day.

    jsulmJ 1 Reply Last reply
    0
    • W Wunian

      @SGaist
      Thanks for your reply and help.
      As you said, "You should set it properly there".
      May I know how I can set customization path?
      I set target.path in pro file, but it doesn't work.
      Thanks.
      Have a nice day.

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #6

      @Wunian if memory serves well, you should append it to the QMAKE_RPATHDIR variable.

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

      W 1 Reply Last reply
      0
      • W Wunian

        Hi,
        My environment is below,
        Mac mini, MacOS M1 64bit, Sonoma 14.2.1
        XCode: 15.2

        I use Qt 6.5.3, and set target path as below,
        unix {
        target.path = /usr/local/lib
        }

        and create my own library, and build it in my release-build folder.

        Next, I copy my library(libMymac.1.0.0.dylib) to /usr/local/lib,
        and create symbolic-link files in the same path as below,
        libMymac.dylib
        libMymac.1.dylib
        libMymac.1.0.dylib

        I also create an application (Mymacapp), and load my own library in the pro file as below,
        LIBS += -L$$PWD/Mymac/ -lMymac.1.0.0
        and build my application, and it works fine.

        Now, I try to deploy my application like this,
        ./macdeployqt Mymacapp.app

        it complains <ERROR: no file at "/usr/lib/libMymac.1.dylib">.

        Here my question is, I set target.path = /usr/local/lib,
        why I get the error path /usr/lib ??

        May I know how I can solve this issue?
        Thanks.
        Have a nice day.

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

        @Wunian said in Deploying my application with my own library is failed.:

        why I get the error path /usr/lib ??

        I guess the macdeployqt tool does not look in /usr/local/lib by default

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

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

          Hi,

          Check your library with otool -L and see what path it contains. You will likely not see /usr/local/lib. You should set it properly there.

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

          W 1 Reply Last reply
          0
          • jsulmJ jsulm

            @Wunian said in Deploying my application with my own library is failed.:

            why I get the error path /usr/lib ??

            I guess the macdeployqt tool does not look in /usr/local/lib by default

            W Offline
            W Offline
            Wunian
            wrote on last edited by
            #4

            @jsulm
            Thanks for your reply and help.

            1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              Check your library with otool -L and see what path it contains. You will likely not see /usr/local/lib. You should set it properly there.

              W Offline
              W Offline
              Wunian
              wrote on last edited by
              #5

              @SGaist
              Thanks for your reply and help.
              As you said, "You should set it properly there".
              May I know how I can set customization path?
              I set target.path in pro file, but it doesn't work.
              Thanks.
              Have a nice day.

              SGaistS 1 Reply Last reply
              0
              • W Wunian

                @SGaist
                Thanks for your reply and help.
                As you said, "You should set it properly there".
                May I know how I can set customization path?
                I set target.path in pro file, but it doesn't work.
                Thanks.
                Have a nice day.

                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #6

                @Wunian if memory serves well, you should append it to the QMAKE_RPATHDIR variable.

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

                W 1 Reply Last reply
                0
                • SGaistS SGaist

                  @Wunian if memory serves well, you should append it to the QMAKE_RPATHDIR variable.

                  W Offline
                  W Offline
                  Wunian
                  wrote on last edited by
                  #7

                  @SGaist
                  I set QMAKE_RPATHDIR += /usr/local/lib in pro file.
                  Thanks for your reply and help.
                  Have a nice day.

                  1 Reply Last reply
                  0
                  • W Wunian has marked this topic as solved on

                  • Login

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