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

两盒软妹~` 提交于 2019-12-24 03:32:29

问题


I am trying to install Lib::XML in my ActiveState Perl Windows machine.

perl 5, version 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?


回答1:


As others mentioned, there doesn't seem to be a pre-compiled PPM for ActiveState Perl 5.20. I contributed instructions for building XML::LibXML from source on Windows. Look for them in the README file that comes with the distribution. 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.

First, get the libxml2 binaries from http://xmlsoft.org/sources/win32/ (currently also available at 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.

Combine all the bin, include, and lib directories under c:\Prog\LibXML. (You can use any directory you prefer; just adjust the instructions accordingly.)

Get the latest version of XML-LibXML from CPAN. Extract it.

Issue these commands in the XML-LibXML-VERSION directory:

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.)

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.




回答2:


As ikegami mentioned, XML-LibXML is available upto perl 5.16 and not later.

ppm install XML-LibXML




回答3:


You can use cpan utility with ActiveState's Perl.

> cpan XML::LibXML


来源:https://stackoverflow.com/questions/29992063/how-can-i-install-libxml-on-activestate-perl-5-20

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!