usr/lib/xxxxx.dylb files?

Discussion in 'Mac Programming' started by Cactus Dan, Jun 4, 2012.

  1. macrumors newbie

    Joined:
    Aug 8, 2010
    #1
    Howdy,

    My question is about linking to .dylib files from the directory:
    Developer/SDKs/MacOSX10.x.sdk/usr/lib/xxxxx.dylib

    ... will the compiled application automatically search the hidden directory:
    usr/lib/xxxxx.dylib

    ...on machines that don't have the developer tools installed?

    Adios,
    Cactus Dan
     
  2. macrumors 65816

    Joined:
    Nov 26, 2007
    Location:
    Austin, TX
    #2
    That directory does not exist on my mac, and I do have the developer tools installed.
     
  3. macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
  4. thread starter macrumors newbie

    Joined:
    Aug 8, 2010
    #4
    Howdy,
    So does that mean I have to link directly to the .dylib file in the hidden folder?

    Adios,
    Cactus Dan
     
  5. macrumors 603

    Joined:
    Aug 9, 2009
    #5
    Read this article:
    http://cocoadev.com/wiki/ApplicationLinking

    Pay attention to the concept of install name. Also the significance of @rpath when used in a dylib install name. There are other @names, too. It won't make sense until you know what an install name is.

    Then read the man page for dyld (man dyld).


    BTW, you're posting relative pathnames instead of absolute. This is relative:
    Code:
    usr/lib/xxxxx.dylib
    
    this is absolute:
    Code:
    /usr/lib/xxxxx.dylib
    
    The absolute path is absolute, regardless of the working directory. The relative path is relative to current working directory, which may be changed.

    http://en.wikipedia.org/wiki/Relative_path
    http://en.wikipedia.org/wiki/Working_directory
     
  6. thread starter macrumors newbie

    Joined:
    Aug 8, 2010
    #6
    Howdy,
    AHA! Thanks for that link.
    So, the actual install path of the .dylib file in question IS in the hidden folder, according to the terminal output:
    Code:
    otool -D /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libiconv.2.dylib 
    /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libiconv.2.dylib:
    /usr/lib/libiconv.2.dylib
    I suspect as much but just wasn't absolutely sure. That terminal command will be added to my list of useful commands.


    Hehe, yeah that's why I never trust my typing and always drag and drop when I need the correct path. ;)

    Thanks again.

    Adios,
    Cactus Dan
     
  7. macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #7
    You should also be aware that the '/Developer' folder no longer exists on the latest versions of Xcode.
     
  8. thread starter macrumors newbie

    Joined:
    Aug 8, 2010
    #8
    Howdy,
    Well, when you unhide the hidden files and directories, do you have the directory:
    /usr/lib/
    ... showing in the root directory of your HD?

    Adios,
    Cactus Dan
     
  9. macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #9
    Yes.

    But Apple considers it theirs and it's contents have changed in past versions of the OS.
     
  10. thread starter macrumors newbie

    Joined:
    Aug 8, 2010
    #10
    Howdy,
    OK, cool. I'm not worried about that because I'm not setting the "Library Search Paths", "Header Search Paths" and "Other Linker Flags" options to that hidden directory. I'll be setting those options to the:
    /Developer/SDKs/MacOSX10.x.sdk/usr/lib/libiconv.dylib
    ...directory, since we've established that the install path of the above directory IS the hidden folder.

    Normally I wouldn't even be concerned with linking to an individual library in one of the Mac OS SDKs, except in this situation I'm creating an FBX import/export plugin for an existing application, which seems to have a problem with their c++ plugin API, where the FBX SDK library can't find the libiconv.dylib. So I have to force the directory search by including the paths in the "Library Search Paths", "Header Search Paths" and "Other Linker Flags".

    If I use the FBX SDK library in a stand alone application, it has no problem finding the libiconv.dylib library.

    Adios,
    Cactus Dan
     

Share This Page