perl - 如何在 Ubuntu 上安装 XML::LibXML

标签 perl ubuntu libxml2

这是安装的标准输出:

$sudo cpanm XML::LibXML
--> Working on XML::LibXML
Fetching http://www.cpan.org/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0014.tar.gz ... OK
Configuring XML-LibXML-2.0014 ... N/A
! Configure failed for XML-LibXML-2.0014. See /home/kahmed/.cpanm/build.log for details.

详情:

Unpacking XML-LibXML-2.0014.tar.gz
Entering XML-LibXML-2.0014
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.55_02)
Configuring XML-LibXML-2.0014
Running Makefile.PL
enable native perl UTF8
running xml2-config...ok (2.9.0)
Checking for ability to link against xml2...no
Checking for ability to link against libxml2...libxml2, zlib, and/or the Math library (-lm) have not been found.
Try setting LIBS and INC values on the command line
Or get libxml2 from
  http://xmlsoft.org/
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.

Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter
to see the exact reason why the detection of libxml2 installation
failed or why Makefile.PL was not able to compile a test program.
-> N/A
-> FAIL Configure failed for XML-LibXML-2.0014. See /home/kahmed/.cpanm/build.log for details.

我尝试手动安装 libxml2,但仍然遇到同样的问题。

另外,我检查了 libxml2-dev:

 sudo apt-get install libxml2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libxml2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 78 not upgraded.

这是系统信息:

 lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 11.04
Release:    11.04
Codename:   natty

uname -a Linux autobot 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

最佳答案

我认为相关的行是:

Checking for ability to link against libxml2...libxml2, zlib, and/or the Math library (-lm) have not been found.

那么,您已经了解了 libxml。你安装了合适的 zlib 包了吗?尝试:

sudo apt-get install zlib1g-dev

然后再次尝试安装 XML::LibXML。

关于perl - 如何在 Ubuntu 上安装 XML::LibXML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13965140/

相关文章:

Perl - Image::Magick 具有 RGB 背景的新图像

linux - 'ln' 或 'ln -s' 的用法或应用场景是什么?

c++ - 使用 libxml2 从 C++ 中的 XML <tag> 获取值

shell - 脚本不是 en 可执行常规文件

ruby-on-rails - Azure Ubuntu 虚拟机上的 Ruby On Rails

html - 我们可以使用正则表达式使用 libxml2 查找具有特定属性值的所有节点吗?

c - libxml2:不单独报告 ' or "等字符

perl - 是否可以在 Perl 调试器中设置断点而不修改源代码?

perl - 为什么Perl的URI提示“无法通过包URI::_ generic找到对象方法” host”?

perl - 为什么 $#ARGV 是 0?