Results 1 to 4 of 4

Thread: osx dylib frustration

  1. #1
    Join Date
    Jan 2007
    Location
    Augsburg, Germany
    Posts
    75
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question osx dylib frustration

    Hello,

    I don't know where exactly I should place this post, so I left out the Qt forums.

    I have a shared core library, a shared gui library, the application itself and Qt. Starting this on windows or linux is no problem, but mac is. When I'm starting my application, I get telled that the core/gui dylib can't be found I have no clue what to do that my program finds these to startup (even with debugger). Having the dylib's within the program's executable dir does not help. Putting them into the application bundle at the same place does not help.
    Only way that works: Putting my two .dylib files onto the filesystem root level "/". But that can't be the way ...

    Sorry for the silly question but I have no experience with osx development. Nor I have a idea where to search.

  2. #2
    Join Date
    Jan 2008
    Location
    Forstinning, Germany
    Posts
    10
    Thanked 7 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: osx dylib frustration

    Hi
    you have to tell the osx binary where to search for the dylib. you can do this with the otool.
    Look at http://doc.qtsoftware.com/4.5/deployment-mac.html
    With 4.5 there is a deployment tool shipped, but I dont't know if that works with dylibs.

    Regards

  3. #3
    Join Date
    Jan 2007
    Location
    Augsburg, Germany
    Posts
    75
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: osx dylib frustration

    I've already tried the deployment tool yesterday, which works for application bundles only.

    My problem is that I don't understand where osx searches for the dylib. I've added the path of my test dylib to $PATH, but I also get "Program cannot be started". It's not a Qt question, more a general mac programming one

    Qt Code:
    1. frickelbude:testprogramm gri$ otool -L testprogramm.app/Contents/MacOS/testprogramm
    2. testprogramm.app/Contents/MacOS/testprogramm:
    3. libtestlib.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    4. QtGui.framework/Versions/4/QtGui (compatibility version 4.5.0, current version 4.5.1)
    5. /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 136.0.0)
    6. /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 949.46.0)
    7. QtCore.framework/Versions/4/QtCore (compatibility version 4.5.0, current version 4.5.1)
    8. /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    9. /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
    10. /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
    11. /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    To copy to clipboard, switch view to plain text mode 

    So there's no path given for testlib, where does osx search? On linux there is something like LD_LIBRARY_PATH, in windows it looks in PATH and the program's directory ...
    Attached Images Attached Images

  4. #4
    Join Date
    Jan 2008
    Location
    Forstinning, Germany
    Posts
    10
    Thanked 7 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: osx dylib frustration

    The environment variable you have to use is DYLD_LIBRARY_PATH.
    You can also read the manpage for "dyld"

    Grüße

  5. The following user says thank you to hwerglmir for this useful post:

    gri (16th May 2009)

Similar Threads

  1. dylib using qt
    By yogeshgokul in forum Installation and Deployment
    Replies: 0
    Last Post: 8th August 2008, 07:27
  2. Symbol Exporting in dylib
    By nareshqt in forum Qt Programming
    Replies: 1
    Last Post: 21st July 2008, 04:36
  3. connecting 2 dylib files
    By munna in forum Installation and Deployment
    Replies: 1
    Last Post: 22nd November 2006, 13:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.