dyld: Library not loaded: /usr/local/lib/libmpfr.4.dylib dyld: Library not loaded: /usr/local/lib/libmpfr.4.dylib xcode xcode

dyld: Library not loaded: /usr/local/lib/libmpfr.4.dylib


I had similar problem in Mac. I fixed it by upgrading the "gawk" using brew

brew upgrade gawk


I solved it like this.

ln -s /usr/local/opt/mpfr/lib/libmpfr.6.dylib /usr/local/opt/mpfr/lib/libmpfr.4.dylib


@Vinc17 is right in his comment to @neosarchizo's proposed solutiion, symlinks can be problematic if referencing a different version, HOWEVER, in my case, running the following command:

locate libmpfr.4.dylib

Showed that I did have the right library in a different directory:

/opt/local/lib/libmpfr.4.dylib

So for me, I felt it was perfectly safe to use the symlink approach, ie:

sudo ln -s /opt/local/lib/libmpfr.4.dylib /usr/local/lib/libmpfr.4.dylib

Probably a hack, but problem solved.