在linux上构建ghostscript时出错

时间:2012-10-01 07:57:36

标签: build install x11 ghostscript configure

我正在尝试在托管的Linux机器上构建Ghostscript(v 9.06),以便我可以操作PDF文件。 ./configuremake一切正常,但后来我遇到了以下错误:

../gs/base/x_.h:135:29: error: X11/Intrinsic.h: No such file or directory

之后我得到了一个有趣的â字符的错误列表,如下所示:

../gs/base/gdevx.c:1138: error: âgx_device_Xâ has no member named âtextâ

这里有什么问题,有什么问题?我认为这是一个符号链接问题,所以我检查了我的X11目录,并运行以下命令:

 ln -s X11 /usr/include/X11

我再次跑make但没有区别。有什么想法吗?

修改

以下是错误的前几行......其余几行都差不多:

../gs/base/x_.h:135:29: error: X11/Intrinsic.h: No such file or directory
../gs/base/x_.h:136:30: error: X11/StringDefs.h: No such file or directory
../gs/base/x_.h:137:25: error: X11/Shell.h: No such file or directory
In file included from ../gs/base/gdevx.c:33:
../gs/base/gdevx.h:30: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âgdev_x_resourcesâ
../gs/base/gdevx.h:32: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âgdev_x_fallback_resourcesâ
../gs/base/gdevx.h:119: error: expected specifier-qualifier-list before âPixelâ
../gs/base/gdevx.c:217: warning: excess elements in struct initializer
../gs/base/gdevx.c:217: warning: (near initialization for âgs_x11_deviceâ)
../gs/base/gdevx.c:217: warning: excess elements in struct initializer
../gs/base/gdevx.c:217: warning: (near initialization for âgs_x11_deviceâ)
../gs/base/gdevx.c:217: error: extra brace group at end of initializer
../gs/base/gdevx.c:217: error: (near initialization for âgs_x11_deviceâ)

最后几行是:

make[2]: *** [obj/gdevx.o] Error 1
make[2]: Leaving directory `/root/ghostpdl-9.06/main'
make[1]: *** [pdl-product] Error 2
make[1]: Leaving directory `/root/ghostpdl-9.06/main'
make: *** [pcl] Error 2

3 个答案:

答案 0 :(得分:4)

事实证明我没有正确安装X包。

我跑了

yum provides \*/Intrinsic.h
yum provides \*/StringDefs.h
yum provides \*/Shell.h

找出获取这些文件的位置,并获得

libXt-devel-1.0.7-1.el6.x86_64 : X.Org X11 

他们每个人。所以我安装了它:

yum install libXt-devel

然后回到我的ghostscript目录,再次运行make./configuremake,瞧。它成功了。

答案 1 :(得分:3)

对于Ubuntu用户

  

sudo apt-get install libxt-dev libxaw7-dev

答案 2 :(得分:2)

你不需要X11来构建Ghostscript,但你需要告诉它不要。如果您运行./configure --without-x,那么GS版本将不包含任何依赖于X的内容(例如显示设备),并且不会查找X库。

只要你不想使用应该工作的X11或X11a设备。

相关问题