我如何在OS X 10.9上使用ghost4j [英] How can i use ghost4j on OS X 10.9
问题描述
当我想在OS X 10.9上使用ghost4j时,我看到此错误:
When i want to use ghost4j on OS X 10.9, i see this error:
无法加载库'gs':dlopen(libgs.dylib,9):找不到图像
Unable to load library 'gs': dlopen(libgs.dylib, 9): image not found
我已经使用此网站在我的Macbook上安装了ghostscript库. 我该如何解决这个问题.由于某种原因,我无法使用port和brew安装ghostscript.
I have installed ghostscript library on my macbook using this site. how can i fix this problem. I can not install ghostscript using port and brew for some reason.
推荐答案
首先,您需要查找由安装程序包安装的文件从源代码编译libgs.dylib
libgs.dylib
库,并记下安装位置.
First you need to find the file compile the libgs.dylib
which was installed by the installer packagelibgs.dylib
library from source, and make a note of where you installed it to.
希望它应该已安装到标准库位置,并且您无需执行其他任何操作.如果不是,则需要设置环境变量DYLD_LIBRARY_PATH.在终端中,可以通过键入export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/directory
并将/directory
替换为包含libgs.dylib
的实际目录的完整路径来完成.键入此命令后,在该终端中,如果您运行您的应用程序,它应该可以工作.要使其永久生效,您需要在~/.bash_profile
中添加export
命令.或者要使其对计算机上的所有用户帐户生效,您可以将其添加到/etc/profile
.
Hopefully it should have been installed to a standard library location, and there should be nothing more you need to do. If not, you need to set the environment variable DYLD_LIBRARY_PATH. In a terminal this would be done by typing export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/directory
, replacing /directory
with the full path of the actual directory containing libgs.dylib
. After typing this, in that terminal, if you run your application, it should work. To make it take effect permanently you would need to add the export
command to your ~/.bash_profile
. Or to make it take effect for all user accounts on your computer, you could add it to your /etc/profile
.
如果这不起作用,我想Ghostscript库可能是32位的-我认为您需要一个64位的库.
If this doesn't work, I suppose the Ghostscript library could be 32-bit - you would need a 64-bit library I think.
这篇关于我如何在OS X 10.9上使用ghost4j的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!