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 7860771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:25:43+00:00 2026-06-02T22:25:43+00:00

I’m trying to get a dylib working in my OSX project. Ive been reading

  • 0

I’m trying to get a dylib working in my OSX project.

Ive been reading a few samples, this one specifically:
Xcode 4 adding dylib

But I still cannot get it to work.

Here are the steps I have performed:

  1. Copied the testing.1.dylib to my Xcode projects folder.
  2. Ran sudo install_name_tool -id @executable_path/../Frameworks/testing.1.dylib testing.1.dylib
  3. Ran: otool -L testing.1.dylib and received the following:

    testing.1.dylib:
    @executable_path/../Frameworks/testing.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

  4. Added the testing.1.dylib as a framework to the project. (Using the link bundle with library option).

  5. At this point when I compile the testing1.dylib does not get copied into the .App/Framework as I expected, so I manually create the Framework path and copy the testing.1.dylib to it:
    a) mkdir -p testing.app/Contents/Frameworks
    b) cp testing.1.dylib testing.app/Contents/Frameworks
  6. In Xcode I update the Runtime Search Paths for BOTH the Target and the Project to be: @executable_path/../Frameworks.

Now I copy the testing.app to a separate freshly installed machine and attempt to run it. Which I get the following error:

dyld: Library not loaded: /user/local/lib/testing1.dylib
Referenced from: /Users/me/testing.app/MacOS/./testing
Reason: image not found

What am I missing?

Notes: When running install_name_tool, I need to use sudo or I get the following errors:

install_name_tool: can’t open input file: testing.1.dylib for writing (Permission denied)
install_name_tool: can’t lseek to offset: 0 in file: testing.1.dylib for writing (Bad file descriptor)
install_name_tool: can’t write new headers in file: testing.1.dylib (Bad file descriptor)
install_name_tool: can’t close written on input file: testing.1.dylib (Bad file descriptor)

  • 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-06-02T22:25:45+00:00Added an answer on June 2, 2026 at 10:25 pm

    You shouldn’t need to copy the library into the project.

    You shouldn’t need to use sudo to change the install name of a file you own. Do you not own the library file? Perhaps you did a “sudo make install” on some third-party project? Just don’t install it and link to the one in the build directory. If you’re building this library, then you should set its install name when it’s built using command-line options to the link command.

    It is expected that adding a library to a target causes it to be linked but doesn’t automatically cause it to be copied. You can create a Copy Files build phase and add the library to that, too.

    You don’t need to set Runpath Search Paths unless you used an @rpath-based install name.

    I suspect that Xcode is actually linking against the library that you copied from in step 1, rather than the copy you made and whose install name you then modified. What does the actual link command from the build transcript say? From where did you copy the library in step 1? If it was from /usr/lib or /usr/local/lib, then Xcode is probably linking against that.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
Specifically, suppose I start with the string string =hello \'i am \' me And
I am trying to render a haml file in a javascript response like so:

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.