ImageMagick and OS X Lion trouble

2019-01-12 17:09发布

[edit] I was troubleshooting problems with my development environment when I noticed one of my problems was the dependency on ImageMagick, since it's a vital part of my app.


After upgrading to OS X Lion (10.7) i no longer had ImageMagick available, i then tried installing again using MacPorts without success, i then installed from source, and the install wasn't very successfully i had convert and identify but it output error messages that i unfortunately dont have anymore, i by some strange reason decided to remove all of my MacPort libraries and started using Homebrew, i tried installing ImageMagick, it installs OK but when i try to use it throws this error

dyld: Library not loaded: /opt/local/lib/libltdl.7.dylib
  Referenced from: /usr/local/bin/convert
  Reason: Incompatible library version: convert requires version 11.0.0 or later, but libltdl.7.dylib provides version 10.0.0
Trace/BPT trap: 5

I read online but i have no clue on whats going on here, i found that libltdl is called libtool, and that i obviously need to upgrade it to a newer version, but i havent found any indication of how or where to find the source, or if this should be already be handled by homebrew and why it hasn't.

I tried installing ImageMagick again from source using this installer script https://github.com/masterkain/ImageMagick-sl but when i try to use convert it throws a similar error.

$ convert gnome.jpg -resize 50% gnome_.jpg
dyld: Library not loaded: /opt/local/lib/libltdl.7.dylib
  Referenced from: /usr/local/bin/convert
  Reason: Incompatible library version: convert requires version 11.0.0 or later, but libltdl.7.dylib provides version 10.0.0
Trace/BPT trap: 5

$ which convert
/usr/local/bin/convert

What can i do to solve my problem?

13条回答
不美不萌又怎样
2楼-- · 2019-01-12 17:34

If you're using Homebrew, try the following command:

brew doctor

to diagnose the common problems.

One of it could be to remove DYLD_FALLBACK_LIBRARY_PATH variable from your ~/.profile if you have it.

Or you have to re-install libtool by:

brew reinstall libtool --universal && brew unlink libtool && brew link libtool
查看更多
Animai°情兽
3楼-- · 2019-01-12 17:38

The same problem might occur with OSX Mountain Lion (preview 4). I had to configure some parts separately because there are some library incompatibilities:

dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib
  Referenced from: /usr/local/bin/convert
  Reason: Incompatible library version: convert requires version 13.0.0 or later, but libjpeg.8.dylib provides version 9.0.0

I had to add --with-fontconfig=no, --with-lzma=no and use /opt/local/share/... instead of /usr/local/share/... for the ghostscript fonts:

cd /tmp
curl -OL ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar -xzf ImageMagick.tar.gz
cd ImageMagick-6.7.8-0/
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp --with-fontconfig=no --with-gs-font-dir=/opt/local/share/ghostscript/fonts --with-lzma=no
make
sudo make install
查看更多
放我归山
4楼-- · 2019-01-12 17:40

On Mountain Lion OSX,

Even with the updated brew for imagemagick(which includes libtool), this error seemed to happen to me.

so i fixed it using the following commands

brew uninstall libtool
brew install libtool --universal
brew link libtool --force
查看更多
The star\"
5楼-- · 2019-01-12 17:43

This helped me after restoring OS X 10.9.3 from time machine.

brew uninstall imagemagick
brew uninstall libtool
brew install libtool --universal
brew unlink libtool && brew link libtool
brew install imagemagick
brew install Homebrew/python/pillow
brew link --overwrite pillow
查看更多
混吃等死
6楼-- · 2019-01-12 17:46

For 10.7.8 and up, you have to install the php version and not the pecl version. Depending on your version of php you've install with Macports you can either do:

sudo port install php-imagick

sudo port install php5-imagick

sudo port install php53-imagick

sudo port install php54-imagick

Remember only to do the one of your current version of php.

查看更多
看我几分像从前
7楼-- · 2019-01-12 17:47

I tried most of the solutions above and they didn't work. Here's how I fixed my problem:

brew install imagemagick;
brew install freetype;
cd /usr/X11/lib/;    
sudo mv libfreetype.6.dylib libfreetype.6.dylib.orig;
sudo ln -s /usr/local/opt/freetype/lib/libfreetype.6.dylib libfreetype.6.dylib

Tested on OS X 10.7.2

查看更多
登录 后发表回答