简体   繁体   English

如何在ActiveState Perl 5.20上安装Lib :: XML?

[英]How can I install Lib::XML on ActiveState Perl 5.20?

I am trying to install Lib::XML in my ActiveState Perl Windows machine. 我正在尝试在ActiveState Perl Windows计算机中安装Lib :: XML。

perl 5, version 20, subversion 2 (v5.20.2) perl 5,版本20,Subversion 2(v5.20.2)

I tried the following: 我尝试了以下方法:

C:\Users\VENKATESH>ppm install XML-LibXML
ppm install failed: Can't find any package that provides XML-LibXML

C:\Users\VENKATESH>ppm install http://theoryx5.uwinnipeg.ca/ppms/XML-LibXML.ppd
ppm install failed: 500 Can't connect to theoryx5.uwinnipeg.ca:80

How do I install packages for Perl on Windows? 如何在Windows上为Perl安装软件包?

As others mentioned, there doesn't seem to be a pre-compiled PPM for ActiveState Perl 5.20. 正如其他人提到的那样,ActiveState Perl 5.20似乎没有预编译的PPM。 I contributed instructions for building XML::LibXML from source on Windows . 我贡献了从Windows上的源代码构建XML :: LibXML的说明 Look for them in the README file that comes with the distribution. 在分发随附的README文件中查找它们。 I haven't done it in a while, but I expect they still work. 我已经有一段时间没有这样做了,但是我希望他们仍然可以工作。 I'll reproduce them here, but you should check the distribution for updates. 我将在这里重现它们,但是您应该检查发行版本以获取更新。

These instructions assume that you already have your system set up to compile modules that use C components. 这些说明假定您已经设置好系统来编译使用C组件的模块。

First, get the libxml2 binaries from http://xmlsoft.org/sources/win32/ (currently also available at http://www.zlatkovic.com/pub/libxml/ ). 首先,从http://xmlsoft.org/sources/win32/获取libxml2二进制文件(当前也可从http://www.zlatkovic.com/pub/libxml/获得 )。

You need: 你需要:

 iconv-VERSION.win32.zip libxml2-VERSION.win32.zip zlib-VERSION.win32.zip 

Download the latest version of each. 下载每个的最新版本。 (Each package will probably have a different version.) When you extract them, you'll get directories named iconv- VERSION .win32, libxml2- VERSION .win32, and zlib- VERSION .win32, each containing bin, lib, and include directories. (每个软件包的版本可能会有所不同。)提取它们时,将得到名为iconv- VERSION .win32,libxml2- VERSION .win32和zlib- VERSION .win32的目录,每个目录均包含bin,lib和include目录。 。

Combine all the bin, include, and lib directories under c:\\Prog\\LibXML . c:\\Prog\\LibXML下合并所有bin,include和lib目录。 (You can use any directory you prefer; just adjust the instructions accordingly.) (您可以使用自己喜欢的任何目录;只需相应地调整说明即可。)

Get the latest version of XML-LibXML from CPAN. 从CPAN获取最新版本的XML-LibXML Extract it. 提取它。

Issue these commands in the XML-LibXML- VERSION directory: 发出的XML-LibXML- 版本目录下面的命令:

 perl Makefile.PL INC=-Ic:\\Prog\\LibXML\\include LIBS=-Lc:\\Prog\\LibXML\\lib nmake copy c:\\Prog\\LibXML\\bin\\*.dll blib\\arch\\auto\\XML\\LibXML nmake test nmake install 

(Note: Some systems use dmake instead of nmake .) (注意:某些系统使用dmake代替nmake 。)

By copying the libxml2 DLLs to the arch directory, you help avoid conflicts with other programs you may have installed that use other (possibly incompatible) versions of those DLLs. 通过将libxml2 DLL复制到arch目录,可以帮助避免与可能已经安装的使用这些DLL其他版本(可能不兼容)的其他程序发生冲突。

As ikegami mentioned, XML-LibXML is available upto perl 5.16 and not later. 正如ikegami所提到的,XML-LibXML在perl 5.16之前可用,并且不晚于。

ppm install XML-LibXML ppm安装XML-LibXML

您可以将cpan实用程序与ActiveState的Perl一起使用。

> cpan XML::LibXML

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM