• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Linking libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linking libraries


  • Subject: Linking libraries
  • From: Matthew Unrath <email@hidden>
  • Date: Fri, 19 Jun 2009 19:58:11 -0700

Hi,

I'm new to Xcode and programming in general.

I am using a library that has a .dylib file. I have added it to my project, and it builds and runs fine. However, when I try to run the application it generates, it brings up an error:

Dyld Error Message:
  Library not loaded: /usr/local/lib/libirrklang.dylib
  Referenced from: /Users/Shared/Empty_Xcode2/build/Release/HelloWorld.app/Contents/MacOS/HelloWorld
  Reason: image not found

I can modify the directory Xcode searches for the .dylib for a Carbon Shell Tool by running a script:

install_name_tool -change /usr/local/lib/libirrklang.dylib @executable_path/libirrklang.dylib "$TARGET_BUILD_DIR/$PRODUCT_NAME"

This makes it look in the directory the Shell Tool is located rather than /usr/local/lib.

It seems that this approach doesn't work for an Application target (the script doesn't work on application files). Is there another way to change the directory in a similar way?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Linking libraries
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Confused by earlier errors
  • Next by Date: Re: Linking libraries
  • Previous by thread: Code signing (and verifying) bundles that don't have any code
  • Next by thread: Re: Linking libraries
  • Index(es):
    • Date
    • Thread