本文介绍了如何在没有 expat-devel 的情况下安装 XML::Parser?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

XML::Parser 无法在全新的 64 位 Debian 机器上构建.发出 cpan XML::Parser 后,cpan 失败,出现很多关于 Expat.c 和 Expat.xs 的错误:

XML::Parser fails to build on a quite fresh 64-bit Debian box. After issuing cpan XML::Parser, cpan fails with lots of errors about Expat.c and Expat.xs:

[...]
Expat.xs:2182: error: ‘CallbackVector’ has no member named ‘skip_until’
Expat.c: In function ‘XS_XML__Parser__Expat_Do_External_Parse’:
Expat.c:2904: error: ‘XML_Parser’ undeclared (first use in this function)
Expat.c:2904: error: expected ‘;’ before ‘parser’
Expat.xs:2194: error: ‘parser’ undeclared (first use in this function)
make[1]: *** [Expat.o] Error 1
make[1]: Leaving directory `/root/.cpan/build/XML-Parser-2.41-rpV6ok/Expat'
make: *** [subdirs] Error 2
  TODDR/XML-Parser-2.41.tar.gz
  /usr/bin/make -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible

输出开头的消息说明构建需要 expat-devel.

Message at the start of the output explains that expat-devel is needed for building.

必须在构建 XML::Parser 之前安装 Expat,但我找不到它在标准库目录中.用你的安装 'expat-devel' 包操作系统包管理器.请参阅自述文件".

expat-devel 不在 Debian 存储库中.

But expat-devel is not in Debian repository.

是否有可能在不需要从源代码构建/安装 expat 的情况下克服这个问题?

Is it possible to get over this without need to build/install expat from source?

推荐答案

你要安装的包名为libexpat1-dev.您也可以通过 apt-get 安装 libxml-parser-perl.或者,如果您真的想通过 CPAN 安装,请先尝试通过 apt-get build-dep libxml-parser-perl 安装 Debian 软件包依赖项.

The package you want to install is named libexpat1-dev. You could also just install libxml-parser-perl via apt-get. Or if you really want to install via CPAN try installing the Debian packages dependencies first via apt-get build-dep libxml-parser-perl.

这篇关于如何在没有 expat-devel 的情况下安装 XML::Parser?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-21 03:28