Using .dylibs in applications

Discussion in 'Mac Programming' started by harkathmaker, Jun 18, 2009.

  1. macrumors newbie

    Jun 18, 2009

    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?
  2. macrumors newbie

    Mar 17, 2008
    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

Share This Page