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. Compiling libraries as sub-projects on OS X
QtWS25 Last Chance

Compiling libraries as sub-projects on OS X

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 1.5k 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.
  • X Offline
    X Offline
    x6herbius
    wrote on last edited by
    #1

    I have an application which uses several internal libraries as sub-projects of the main project, which I reference using "Add library" within Qt Creator. This works fine for Windows when I choose "Run" from Creator, but on OS X I get errors that the libraries cannot be found. What's the best way to remedy this? I'd rather not have to copy the libraries to /usr/lib manually each time, as running cp as a custom step gives me "Permission denied" when I try to set it up to do this.

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

      Hi,

      You have two possibilities here:

      Use DYLD_LIBRARY_PATH

      Set the install_name of your libraries at link times

      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
      • X Offline
        X Offline
        x6herbius
        wrote on last edited by
        #3

        Can I set DYLD_LIBRARY_PATH temporarily from the Project tab? I'm not 100% familiar with how things work on Mac (just got a MacBook a couple of days ago) but am familiar with Qt.

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

          Sure you can: Project Panel -> Run -> Environment and there you can either update it or add it if it doesn't exists

          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
          • X Offline
            X Offline
            x6herbius
            wrote on last edited by
            #5

            I set the DYLD_LIBRARY_PATH variable to

            @DYLD_LIBRARY_PATH:%{buildDir}/model:%{buildDir}/view@

            and I still just get this:

            @dyld: Library not loaded: libmodel.1.dylib
            Referenced from: /Users/mac/Documents/fyp/crowbar/build-crowbar-Desktop_Qt_5_3_clang_64bit-Debug/sandbox01/sandbox01.app/Contents/MacOS/sandbox01
            Reason: image not found
            The program has unexpectedly finished.@

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

              I'm not sure that the placeholders work there. I've always used the full paths

              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
              • X Offline
                X Offline
                x6herbius
                wrote on last edited by
                #7

                Aha, that seems to work. Thank you very much!

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

                  You're welcome !

                  Enjoy and happy coding ! :)

                  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

                  • Login

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