libpng not linked on Mac OSX 10.9.2

TonyGW picture TonyGW · Apr 1, 2014 · Viewed 17.5k times · Source

I installed matrix2png on my Mac and had used it without problem before last week when I installed another image manipulating tool "circos". Circos requires me to install a different version of libpng, and I did. After that, I am no longer able to run matrix2png, which gives me the following error. I think the old ligpnb is not linked any more. Does anyone know how to fix this error? - appreciate your help.

dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib
  Referenced from: /usr/local/bin/matrix2png
  Reason: image not found

Answer

gkiwi picture gkiwi · Apr 16, 2014

Those step solve my problem:

brew versions libpng

You will see some versions of libpng, but unfortunately not 1.5.15, so next you should install 1.5.18.

git checkout 7bec702 Library/Formula/libpng.rb
brew install libpng

You'll will find version 1.5.18 and some another versions.

ln -s /usr/local/Cellar/libpng/1.5.18/lib/libpng15.15.dylib /usr/local/lib/libpng15.15.dylib`

See https://github.com/Homebrew/homebrew-php/issues/1055

Some more info on installing certain versions of brew formulas can be found at https://coderwall.com/p/lqphzg.