title: Updating a dylib to reference correct versions of other dylibs (Homebrew)
body: <p>I'm trying to build a program that uses QT and OpenCV.  It compiles correctly, but when I run the application I get:</p>
  
  <pre><code>Starting /Users/Me/MyApp/Contents/MacOS/Foo...
  dyld: Library not loaded: /usr/local/lib/libavformat.54.29.104.dylib
    Referenced from: /usr/local/lib/libopencv_highgui.2.4.3.dylib
    Reason: image not found
  The program has unexpectedly finished.
  /Users/Me/MyApp/Contents/MacOS/Foo exited with code 0
  </code></pre>
  
  <p>I've had a look in my <code>/usr/local/lib</code>, the files are properly linked there, the issue is that <code>libav</code> is now at a higher version and <code>opencv</code> doesn't reflect this (e.g. looking at the opencv dylib in a hex editor I see that it wants what it says above, but what's actually in my lib folder is e.g. version <code>54.59.106</code>.  I've tried runnning <code>brew update/upgrade</code> and relinking everything, but no luck.</p>
  
  <p>I can make a quick fix by copying the offending dylibs and renaming them to older versions.  This does cause the program to open correctly, but it's a bit of a hack.</p>
  
  <p>Obviously I could probably fix this with a reinstall of the relevant libraries, but that takes precious time.. from this thread it seems like the only option, but I don't know if that's been fixed yet: <a href="https://github.com/mxcl/homebrew/issues/11832" rel="nofollow">https://github.com/mxcl/homebrew/issues/11832</a></p>