title: How to set dyld_library_path in Xcode
body: <p>I am new to Xcode and Mac environment. I am using some dynamic and static libraries like boost, Clucene, etc. I have all the libraries under</p>
  
  <blockquote>
    <p>MyApp.app/Contents/Resources</p>
  </blockquote>
  
  <p>I want to set this path as the app's dyld_library_path. I tried editing XXX.plist file like</p>
  
  <blockquote>
    <p>DYLD_LIBRARY_PATH  /mypath/xxx </p>
  </blockquote>
  
  <p>and setting the environment variable and argument in Xcode Nothing work.</p>
  
  <p>but if I run a shell script like below without double clicking the app in my .dmg it works</p>
  
  <pre><code>#!/bin/bash
  clear
  cd /Volumes/xxx/myapp.app/Contents/MacOS
  export DYLD_LIBRARY_PATH="/Volumes/xxx/myapp.app/Contents/Resources"
  ./myapp
  </code></pre>
  
  <p>I am sure this is not the proper way to do this. Is there proper way to set dyld_library_path every time I execute my app?</p>
  
  <p>EDIT:
  It also works if u mannualy copy all ur library to clients /usr/lib path... i guess this is also not a proper way to do it.</p>