如何为 Perl 的 XML::LibXSLT 安装 libXSLT?
当我运行 Perl 脚本时,我得到
Can't locate XML/LibXSLT.pm in @INC
So I try do this in cpan
:
cpan> install XML::LibXSLT CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Database was generated on Fri, 02 Oct 2009 13:28:24 GMT Running install for module XML::LibXSLT Running make for P/PA/PAJAS/XML-LibXSLT-1.68.tar.gz CPAN: Digest::MD5 loaded ok CPAN: Compress::Zlib loaded ok Checksum for /root/.cpan/sources/authors/id/P/PA/PAJAS/XML-LibXSLT-1.68.tar.gz ok Scanning cache /root/.cpan/build for sizes XML-LibXSLT-1.68/ XML-LibXSLT-1.68/perl-libxml-mm.h XML-LibXSLT-1.68/t/ XML-LibXSLT-1.68/t/08literal.t XML-LibXSLT-1.68/t/09exslt.t XML-LibXSLT-1.68/t/02dromeds.t XML-LibXSLT-1.68/t/01basic.t XML-LibXSLT-1.68/t/14security.t XML-LibXSLT-1.68/t/12import.t XML-LibXSLT-1.68/t/05quick.t XML-LibXSLT-1.68/t/03input.t XML-LibXSLT-1.68/t/13error.t XML-LibXSLT-1.68/t/11utf8.t XML-LibXSLT-1.68/t/04params.t XML-LibXSLT-1.68/t/06entities.t XML-LibXSLT-1.68/t/06output.t XML-LibXSLT-1.68/t/07blankdoc.t XML-LibXSLT-1.68/t/10functions.t XML-LibXSLT-1.68/testcases/ XML-LibXSLT-1.68/testcases/default.conf XML-LibXSLT-1.68/Changes XML-LibXSLT-1.68/example/ XML-LibXSLT-1.68/example/1.xsl XML-LibXSLT-1.68/example/2.xsl XML-LibXSLT-1.68/example/fatal.xsl XML-LibXSLT-1.68/example/nonfatal.xsl XML-LibXSLT-1.68/example/bad1.xsl XML-LibXSLT-1.68/example/1.xml XML-LibXSLT-1.68/example/bad3.xsl XML-LibXSLT-1.68/example/bad2.xsl XML-LibXSLT-1.68/example/2.xml XML-LibXSLT-1.68/MANIFEST XML-LibXSLT-1.68/typemap XML-LibXSLT-1.68/Driver/ XML-LibXSLT-1.68/Driver/LibXSLT.pm XML-LibXSLT-1.68/Driver/Sablotron.pm XML-LibXSLT-1.68/Driver/BaseClass.pm XML-LibXSLT-1.68/perl-libxml-mm.c XML-LibXSLT-1.68/LibXSLT.pm XML-LibXSLT-1.68/benchmark.pl XML-LibXSLT-1.68/ppport.h XML-LibXSLT-1.68/LibXSLT.xs XML-LibXSLT-1.68/Makefile.PL XML-LibXSLT-1.68/README XML-LibXSLT-1.68/META.yml Removing previously used /root/.cpan/build/XML-LibXSLT-1.68 CPAN.pm: Going to build P/PA/PAJAS/XML-LibXSLT-1.68.tar.gz running xslt-config... failed using fallback values for LIBS and INC options: LIBS='-L/usr/local/lib -L/usr/lib -lxslt -lxml2 -lz -lm' INC='-I/usr/local/include -I/usr/include' If this is wrong, Re-run as: $ /usr/bin/perl Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include' looking for -lxslt... no libxslt not found Try setting LIBS and INC values on the command line Or get libxslt and libxml2 from http://www.libxml.org/ If you install via RPMs, make sure you also install the -devel RPMs, as this is where the headers (.h files) are. make: *** No targets specified and no makefile found. Stop. /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
So...no lucky.我尝试编写 cpan>;安装 XML::XSLT
已安装,但我的脚本仍然无法工作。我现在能做什么?
我还尝试使用 YaST 安装软件包。成功了,然后我尝试了上面的方法,仍然没有成功。
-额外-
我还尝试构建绑定。从 http://cpan.uwinnipeg.ca/dist/XML-LibXSLT 我解压并写道
# perl Makefile.PL running xslt-config... failed using fallback values for LIBS and INC options: LIBS='-L/usr/local/lib -L/usr/lib -lxslt -lxml2 -lz -lm' INC='-I/usr/local/include -I/usr/include' If this is wrong, Re-run as: $ /usr/bin/perl Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include' looking for -lxslt... no libxslt not found Try setting LIBS and INC values on the command line Or get libxslt and libxml2 from http://www.libxml.org/ If you install via RPMs, make sure you also install the -devel RPMs, as this is where the headers (.h files) are.
When I run a Perl script I get
Can't locate XML/LibXSLT.pm in @INC
So I try doing this in cpan
:
cpan> install XML::LibXSLT CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Database was generated on Fri, 02 Oct 2009 13:28:24 GMT Running install for module XML::LibXSLT Running make for P/PA/PAJAS/XML-LibXSLT-1.68.tar.gz CPAN: Digest::MD5 loaded ok CPAN: Compress::Zlib loaded ok Checksum for /root/.cpan/sources/authors/id/P/PA/PAJAS/XML-LibXSLT-1.68.tar.gz ok Scanning cache /root/.cpan/build for sizes XML-LibXSLT-1.68/ XML-LibXSLT-1.68/perl-libxml-mm.h XML-LibXSLT-1.68/t/ XML-LibXSLT-1.68/t/08literal.t XML-LibXSLT-1.68/t/09exslt.t XML-LibXSLT-1.68/t/02dromeds.t XML-LibXSLT-1.68/t/01basic.t XML-LibXSLT-1.68/t/14security.t XML-LibXSLT-1.68/t/12import.t XML-LibXSLT-1.68/t/05quick.t XML-LibXSLT-1.68/t/03input.t XML-LibXSLT-1.68/t/13error.t XML-LibXSLT-1.68/t/11utf8.t XML-LibXSLT-1.68/t/04params.t XML-LibXSLT-1.68/t/06entities.t XML-LibXSLT-1.68/t/06output.t XML-LibXSLT-1.68/t/07blankdoc.t XML-LibXSLT-1.68/t/10functions.t XML-LibXSLT-1.68/testcases/ XML-LibXSLT-1.68/testcases/default.conf XML-LibXSLT-1.68/Changes XML-LibXSLT-1.68/example/ XML-LibXSLT-1.68/example/1.xsl XML-LibXSLT-1.68/example/2.xsl XML-LibXSLT-1.68/example/fatal.xsl XML-LibXSLT-1.68/example/nonfatal.xsl XML-LibXSLT-1.68/example/bad1.xsl XML-LibXSLT-1.68/example/1.xml XML-LibXSLT-1.68/example/bad3.xsl XML-LibXSLT-1.68/example/bad2.xsl XML-LibXSLT-1.68/example/2.xml XML-LibXSLT-1.68/MANIFEST XML-LibXSLT-1.68/typemap XML-LibXSLT-1.68/Driver/ XML-LibXSLT-1.68/Driver/LibXSLT.pm XML-LibXSLT-1.68/Driver/Sablotron.pm XML-LibXSLT-1.68/Driver/BaseClass.pm XML-LibXSLT-1.68/perl-libxml-mm.c XML-LibXSLT-1.68/LibXSLT.pm XML-LibXSLT-1.68/benchmark.pl XML-LibXSLT-1.68/ppport.h XML-LibXSLT-1.68/LibXSLT.xs XML-LibXSLT-1.68/Makefile.PL XML-LibXSLT-1.68/README XML-LibXSLT-1.68/META.yml Removing previously used /root/.cpan/build/XML-LibXSLT-1.68 CPAN.pm: Going to build P/PA/PAJAS/XML-LibXSLT-1.68.tar.gz running xslt-config... failed using fallback values for LIBS and INC options: LIBS='-L/usr/local/lib -L/usr/lib -lxslt -lxml2 -lz -lm' INC='-I/usr/local/include -I/usr/include' If this is wrong, Re-run as: $ /usr/bin/perl Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include' looking for -lxslt... no libxslt not found Try setting LIBS and INC values on the command line Or get libxslt and libxml2 from http://www.libxml.org/ If you install via RPMs, make sure you also install the -devel RPMs, as this is where the headers (.h files) are. make: *** No targets specified and no makefile found. Stop. /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
So... no luck. I tried writing cpan> install XML::XSLT
which installed but my script still doesn't work. What can I do now?
I also tried using YaST to install the packages. It was a success, then I tried the above and still no luck.
-extra-
I also tried building the bindings. From http://cpan.uwinnipeg.ca/dist/XML-LibXSLT I untar and wrote
# perl Makefile.PL running xslt-config... failed using fallback values for LIBS and INC options: LIBS='-L/usr/local/lib -L/usr/lib -lxslt -lxml2 -lz -lm' INC='-I/usr/local/include -I/usr/include' If this is wrong, Re-run as: $ /usr/bin/perl Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include' looking for -lxslt... no libxslt not found Try setting LIBS and INC values on the command line Or get libxslt and libxml2 from http://www.libxml.org/ If you install via RPMs, make sure you also install the -devel RPMs, as this is where the headers (.h files) are.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 ubuntu 上尝试
on ubuntu try
您缺少
libxslt
库,该库应该可以使用操作系统的标准包分发系统获得(例如,可以在 macports for Darwin,但您也可以从此处的源代码下载 :这是输出的关键部分,表明了这一点
编辑:由于您似乎使用的是 OpenSUSE,因此您可以直接从此处下载该库: http://www.novell.com/products/linuxpackages/opensuse/libxslt.html。
You are missing the
libxslt
library, which should be available using your OS's standard package distribution system (e.g. it's available on macports for Darwin, but you can also download it from source here.This is the key part of the output that indicates this:
EDIT: since you seem to be using OpenSUSE, you can download the library directly from here: http://www.novell.com/products/linuxpackages/opensuse/libxslt.html.
[回应现在合并的问题“我找不到 exslt”:]
您是否正在寻找比 www.exslt.org?
[In response to the now-merged question "I can't find exslt":]
Are you looking for a more detailed answer than www.exslt.org?
从 YaST 安装
libxml2-devel
和libxslt-devel
软件包。Install the packages
libxml2-devel
andlibxslt-devel
from YaST.