Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:49:28+00:00 2026-05-29T18:49:28+00:00

I am developing a Cocoa Application using the latest version of Xcode 4, I

  • 0

I am developing a Cocoa Application using the latest version of Xcode 4, I want to link dynamic libraries to my project (dylibs).

I read somewhere that adding the libraries in my project was not enough as I have to run install_name_tool and otool to make my project use the libraries that were bundled in my project.

I have read the manual pages for install_name_tool, but I do not understand WHY I have to do this.

How do libraries work? Especially interested in the part where the application and the libraries have paths that point to specific places in my machine, like /usr/local/lib/mylibrary.dylib when running otool -L

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:49:35+00:00Added an answer on May 29, 2026 at 6:49 pm

    Apple has several ways of locating shared libraries:

    1. @executable_path : relative to the main executable
    2. @loader_path : relative to the referring binary
    3. @rpath : relative to any of a list of paths.

    @rpath is the most recent addition, introduced in OS X 10.5.

    If for instance you want to have your executable in Contents/MacOS and libraries in Contents/Libraries you could do the following:

    install_name_tool -id @rpath/Libraries/lib_this.dylib   builddir/lib_this.dylib
    

    and in the top-level executable set rpath with:

    install_name_tool -add_rpath @loader_path/..  myexecutable
    

    and:

    install_name_tool -change builddir/lib_this.dylib @rpath/Libraries/lib_this.dylib myexecutable
    

    Note: that the first path after -change must match exactly what is currently in the binary.

    If you get lost otool -l -v myexecutable will tell you what load commands exactly are currently in the executable.

    See man dyld and man install_name_tool for more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a newbie Cocoa developer and I'm developing my first application. I want to
I am not much familiar with developing application using cocoa on mac. Can some
I'm developing a Cocoa application and want to be able to click a button
I am developing an application in Cocoa. I want to constantly check whether the
I'm developing a Cocoa application, and I'm using constant NSString s as ways to
I am developing an application in cocoa which needs to read the iTunes XML
I'm developing a Cocoa app using XCode 4. One of the windows has a
I am developing an OS X/Cocoa application and I want behavior like this: There
I am developing a cocoa application that will be making heavy use of both
I am developing a Cocoa application which communicates constantly with a web service to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.