.profile
看起来像这样:export MAGICK_HOME="~/Documents/software/ImageMagick-7.0.7" export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/" export PATH="$MAGICK_HOME/bin:$PATH"
convert
时,我得到:dyld:未加载库: /ImageMagick-7.0.7/lib/libMagickCore-7.Q16HDRI.4.dylib
参考自:/Users/oa/Documents/software/ImageMagick-7.0.7/bin/convert
原因:找不到图像 中止陷阱:6
答案 0 :(得分:5)
根据@Mark Setchell的建议,解决方案是将~
替换为$HOME
。因此,导出命令应为:
export MAGICK_HOME="$HOME/Documents/software/ImageMagick-7.0.7"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
export PATH="$MAGICK_HOME/bin:$PATH"
答案 1 :(得分:0)
对于那些不使用 brew 的人,使用 otool -L 显示问题:
/ImageMagick-7.0.10/lib/libMagickCore-7.Q16HDRI.8.dylib (compatibility version 9.0.0, current version 9.0.0)
/ImageMagick-7.0.10/lib/libMagickWand-7.Q16HDRI.8.dylib (compatibility version 9.0.0, current version 9.0.0)
/opt/X11/lib/libfreetype.6.dylib (compatibility version 19.0.0, current version 19.6.0)
/opt/X11/lib/libpng16.16.dylib (compatibility version 43.0.0, current version 43.0.0)
/opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/opt/X11/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0)
/opt/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.1.0)
/opt/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
/opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)