Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] Deploying a dylib file on mac
Forum Update on Monday, May 27th 2025

[SOLVED] Deploying a dylib file on mac

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 2 Posters 2.4k 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.
  • I Offline
    I Offline
    igorland
    wrote on 3 Sept 2014, 21:52 last edited by
    #1

    Hello. I have created a mac plugin, which is basically a dylib file. The plugin includes a couple of boost libraries, and no qt libs. Now I am trying to deploy it and, understandably, receive a dependancy error:

    @
    Get the following error in the Log.txt:
    dlerror:dlopen(/Users/igorland/X-Plane 10/Resources/plugins/MyPlugin/mac.xpl, 6): Library not loaded: /usr/local/lib/libboost_system.dylib
    Referenced from: /Users/igorland/X-Plane 10/Resources/plugins/MyPlugin/mac.xpl
    Reason: image not found@

    So, I try to link the boost_system library.

    First like this:
    @
    LIBS +=
    -L/usr/local/Cellar/boost/1.55.0_2/lib
    -lboost_system@

    Then like this:

    @LIBS +=
    -L/usr/local/Cellar/boost/1.55.0_2/lib/libboost_system.a@

    Then, I select the project file and add an external library through the menu, which adds the following:

    @win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/Cellar/boost/1.55.0_2/lib/release/ -lboost_system
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/Cellar/boost/1.55.0_2/lib/debug/ -lboost_system
    else:unix: LIBS += -L$$PWD/../../../../../../usr/local/Cellar/boost/1.55.0_2/lib/ -lboost_system

    INCLUDEPATH += $$PWD/../../../../../../usr/local/Cellar/boost/1.55.0_2/lib
    DEPENDPATH += $$PWD/../../../../../../usr/local/Cellar/boost/1.55.0_2/lib

    win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/Cellar/boost/1.55.0_2/lib/release/libboost_system.a
    else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/Cellar/boost/1.55.0_2/lib/debug/libboost_system.a
    else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/Cellar/boost/1.55.0_2/lib/release/boost_system.lib
    else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/Cellar/boost/1.55.0_2/lib/debug/boost_system.lib
    else:unix: PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/Cellar/boost/1.55.0_2/lib/libboost_system.a@

    In all cases, I still have the same issue with the file.

    When I did my first Qt application on Mac, I had to use the Qt Mac Deployment Tool to link the libraries. However, my understanding is that since it is not an app bundle but a dll, sorry dylib, I cannot do it. What is the proper way to link statically libraries in a dylib (this and a couple of others like libc++.)

    Thanks a lot in advance.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Sept 2014, 23:22 last edited by
      #2

      Hi,

      You have to link to the corresponding a files, or depending on your needs you could also to the framework way (it doesn't look like an option but I may be wrong)

      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
      • I Offline
        I Offline
        igorland
        wrote on 4 Sept 2014, 00:43 last edited by
        #3

        Thank you, SGaist!
        [quote author="SGaist" date="1409786537"]Hi,

        You have to link to the corresponding a files, ...[/quote]

        Sorry, SGaist, but isn't it what I am doing by:

        @LIBS +=
        -L/usr/local/Cellar/boost/1.55.0_2/lib/libboost_system.a@

        Although, in this case, the error is a bit different:

        @dlerror:dlopen(/Users/igorland/X-Plane 10/Resources/plugins/iGoDispatchConnect/mac.xpl, 6): Symbol not found: __ZN5boost6system15system_categoryEv
        Referenced from: /Users/igorland/X-Plane 10/Resources/plugins/iGoDispatchConnect/mac.xpl
        Expected in: flat namespace
        in /Users/igorland/X-Plane 10/Resources/plugins/iGoDispatchConnect/mac.xpl@

        Thank you so much for always being supportive!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 4 Sept 2014, 21:05 last edited by
          #4

          Indeed, it's what you are doing.

          Can you show what otool -L returns when run on you dylib file ?

          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
          • I Offline
            I Offline
            igorland
            wrote on 4 Sept 2014, 22:30 last edited by
            #5

            SGaist, thanks for your support.

            Re-read multiple threads and tutorials again. Argh! Little things...

            @LIBS += /usr/local/Cellar/boost/1.55.0_2/lib/libboost_system.a@

            NOT

            @LIBS +=
            -L/usr/local/Cellar/boost/1.55.0_2/lib/libboost_system.a@

            It is working great now. Many thanks!

            1 Reply Last reply
            0

            1/5

            3 Sept 2014, 21:52

            • Login

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