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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:23:05+00:00 2026-05-27T20:23:05+00:00

I am having trouble getting a my XCode 4.2 project to run against a

  • 0

I am having trouble getting a my XCode 4.2 project to run against a dynamic library (dynlib).

What I am doing is adding the library into xcode project, and then creating a new ‘Copy Files’ build phase with this lib.

The project does(!) run well if I set the Destination in the build phase to ‘Products Directory’, but then I have to deliver the lib with the app as opposed to embedded inside it.

I get the error in the title in all other settings of Destination in the build phase.

Also, I tried to quit xcode, delete build directory, clean, and all such tricks.

Is there a project/target setting I am missing?
Why is XCode looking for the dynlib in ‘../lib/’? (as shown in error)

  • 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-27T20:23:06+00:00Added an answer on May 27, 2026 at 8:23 pm

    You have two options a) change the library ID, b) change the final product.

    The ID is embedded in the dylib and it defines where dyld will look for it. The ID is taken from the library at link time (when no other special flags are used). You can check it with otool -L, e.g.:

    gammu:~$ otool -L /usr/lib/libz.dylib 
    /usr/lib/libz.dylib:
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.0.0)
    

    The first line is the ID of the dylib. You can change it using install_name_tool -id <path> <library>. One option you have is to use the special form @executable_path/... which looks starting from the location of your binary (there are others as well).

    The second option (achieving the same thing) is to change the path to the library in your product. You can check how it links libraries with the same otool -L command:

    gammu:~$ otool -L /usr/bin/emacs
    /usr/bin/emacs:
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.0.0)
    

    You can then change the libraries with install_name_tool -change <old> <new> <target>, e.g.:

    install_name_tool -change ../lib/abc.dynlib @executable_path/../lib/abc.dylib foo
    

    Finally, note that Xcode usually does all this for you automatically if you let it manage the dylib (instead of copying it manually).

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

Sidebar

Related Questions

I've been having trouble getting my ASP.NET application to automatically log users into the
Again, Xcode newb here ... So I'm having trouble getting my Items (code not
I'm having trouble getting my app to rotate since switching to Xcode 4 and
I am having trouble getting cURL to run on Windows. I have downloaded a
I'm having trouble getting a rotary encoder to work properly with AVR micro controllers.
I'm having trouble getting the following to work in SQL Server 2k, but it
I'm having trouble getting the right number of elements in the ArrayList alt in
I am having trouble getting my ASP.NET application to start an application. For example
I'm having trouble getting a rails app on Dreamhost's Passenger to see compiled libraries
I'm having trouble getting in touch with SQL Server Managemen Studio 2008! I want

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.