title: dyld not loaded Reason: image not found libopencv_core.2.4.dylib
body: <p>I'm still quite new to Objective C and Xcode, but I just finished a small app that uses the openCV <code>libopencv_core.2.4.2.dylib</code>.</p>
  
  <p>When I went to open the final built app on <strong>another machine</strong>, OS X threw me this error:</p>
  
  <pre><code>Dyld Error Message:   Library not loaded: */libopencv_core.2.4.dylib  
  Referenced from: /Users/USER/Desktop/my
  app.app/Contents/MacOS/my app   
  Reason: image not found
  </code></pre>
  
  <p>Why is my app looking for 2.4 instead of 2.4.2 here?</p>
  
  <p>What I already checked:</p>
  
  <p>I added a new build phase -> so that <code>libopencv_core.2.4.2.dylib</code> is copied to the app package (via "Copy Bundle Resources" in Xcode) - <code>libopencv_core.2.4.2.dylib</code> now lies in my <code>app.app/Resources</code></p>
  
  <p>What did I miss? Do I have so set some more library search paths or similar?</p>
  
  <p>What I also did:</p>
  
  <pre><code>install_name_tool -id "@executable_path/../Frameworks/libopencv_core.2.4.2.dylib" libopencv_core.2.4.2.dylib
  </code></pre>
  
  <p>Copying the dylib to the Frameworks directory doesn't work either:</p>
  
  <pre><code>Library not loaded: @executable_path/../Frameworks/libopencv_core.2.4.2.dylib
  </code></pre>
  
  <p>Don't know what to do now - the dylib <em>is</em> in the Frameworks directory of my app...</p>
  
  <p>Using <code>otool -L</code> on the binary gives me:</p>
  
  <pre><code>/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 19.0.0)
      @loader_path/../Frameworks/libopencv_core.2.4.2.dylib (compatibility version 2.4.0, current version 2.4.2)
      @loader_path/../Frameworks/libopencv_highgui.2.4.2.dylib (compatibility version 2.4.0, current version 2.4.2)
      @loader_path/../Frameworks/libopencv_imgproc.2.4.2.dylib (compatibility version 2.4.0, current version 2.4.2)
      /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 945.11.0)
      /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
      /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
      /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
      /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.1.0)
      /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData (compatibility version 1.0.0, current version 407.7.0)
      /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1187.33.0)
  </code></pre>