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. how change the @rpath value on macos
Forum Update on Monday, May 27th 2025

how change the @rpath value on macos

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 2.1k 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.
  • P Offline
    P Offline
    Princein
    wrote on 22 Jan 2019, 09:32 last edited by
    #1

    Hi:
    I developed a qt project on macos, my executable file link the qt framework like this :
    @rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.11.0, current version 5.11.3)

    now I want to change the @rpath to the custom directory path which in my .app content directory, what should I do in my .pro file, thanks a lot!

    R 1 Reply Last reply 22 Jan 2019, 09:44
    0
    • P Princein
      22 Jan 2019, 09:32

      Hi:
      I developed a qt project on macos, my executable file link the qt framework like this :
      @rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.11.0, current version 5.11.3)

      now I want to change the @rpath to the custom directory path which in my .app content directory, what should I do in my .pro file, thanks a lot!

      R Offline
      R Offline
      Ratzz
      wrote on 22 Jan 2019, 09:44 last edited by Ratzz
      #2

      @Princein

      You can do something like this

      unix:QMAKE_RPATHDIR += /usr/mylib
      

      This may help.

      --Alles ist gut.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Princein
        wrote on 22 Jan 2019, 09:47 last edited by
        #3

        it not work on macos

        R S 2 Replies Last reply 22 Jan 2019, 09:54
        0
        • P Princein
          22 Jan 2019, 09:47

          it not work on macos

          R Offline
          R Offline
          Ratzz
          wrote on 22 Jan 2019, 09:54 last edited by Ratzz
          #4

          @Princein
          May be DEFINES += MY_LIB_PATH=/usr/mylib
          and use "$$MY_LIB_PATH"

          --Alles ist gut.

          1 Reply Last reply
          0
          • P Princein
            22 Jan 2019, 09:47

            it not work on macos

            S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 22 Jan 2019, 22:13 last edited by
            #5

            @Princein said in how change the @rpath value on macos:

            it not work on macos

            Can you give more details ?

            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
            • H Offline
              H Offline
              hskoglund
              wrote on 23 Jan 2019, 14:45 last edited by
              #6

              Had a similar problem, I resorted to use the tools inside Xcode's toolchain, there are 2 of them: otool and install_name_tool

              otool you use to dump what .dlls the app will try to load. Easiest is to first navigate down to the MacOS subdirectory where the .exe file is located, then to list the load command (assuming your app is called untitled) try:
              otool -l untitled

              To change the @rpath loading commands, you use install_name_tool, for example:
              install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @rpath/YourCustomDirectoryPath untitled

              1 Reply Last reply
              0

              1/6

              22 Jan 2019, 09:32

              • Login

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