PDA

View Full Version : Using .dylibs in applications




harkathmaker
Jun 19, 2009, 12:54 AM
Hi,

I am trying to use a .dylib file in an Xcode project. In the example I am following, there is a custom script added:


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


It changes the directory where Xcode searches for the .dylib from a certain directory to the same place as the created file.

This works for a Carbon shell target, but not for an application. I was wondering, is there a way to accomplish this same thing with a .app target?



vishvesh
Jul 8, 2009, 08:28 AM
right click the carbon target,
select add-> new build phase->new run script build phase

in new window opened add the following

install_name_tool -change /usr/local/lib/xyz.dylib /path/xyz.dylib "appName"
install_name_tool -id /path/xyz.dylib xyz.dylib

It should work fine after this