2

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?

ThisSuitIsBlackNot
  • 23,492
  • 9
  • 63
  • 110
Venkatesh
  • 303
  • 1
  • 10
  • 22
  • 2
    ActiveState's ppm repo [doesn't have it](http://code.activestate.com/ppm/XML-LibXML/) for newer versions of Perl. So unless you know of another repository, you'll need to compile libxml2 and then use `cpan XML::LibXML`. – ikegami May 01 '15 at 17:50
  • Please copy and paste error text into your questions instead of using screenshots. – ThisSuitIsBlackNot May 01 '15 at 17:51

3 Answers3

2

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.

cjm
  • 61,471
  • 9
  • 126
  • 175
  • am using Win64bit .where can i find zip files for x64?? – Venkatesh May 05 '15 at 14:01
  • @VENKATESH, did you try the [64bit directory](http://xmlsoft.org/sources/win32/64bit/)? But it's the version of Perl that's most important. You can install 32-bit Perl on Win64, in which case you'd want the 32-bit libxml. – cjm May 05 '15 at 14:35
  • > Get the latest version of XML-LibXML from CPAN. Extract it. => I could not find any zip file or 7z file here – Venkatesh May 05 '15 at 15:16
  • @VENKATESH, there isn't one. You'll need to find a utility that can extract `.tar.gz` files. I believe [7-Zip](http://www.7-zip.org/) will do it. – cjm May 05 '15 at 15:22
  • E:\work\perlWork\XML-LibXML-2.0121>perl Makefile.PL INC=-Ic:\Prog\LibXML\include LIBS=-Lc:\Prog\LibXML\lib enable native perl UTF8 Checking for ability to link against xml2...no Checking for ability to link against libxml2...libxml2, zlib, and/or the Math li brary (-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. – Venkatesh May 05 '15 at 15:38
  • 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. – Venkatesh May 05 '15 at 15:38
1

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

ppm install XML-LibXML

Community
  • 1
  • 1
Venkatesh
  • 303
  • 1
  • 10
  • 22
0

You can use cpan utility with ActiveState's Perl.

> cpan XML::LibXML
gangabass
  • 10,607
  • 2
  • 23
  • 35
  • brary (-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. No 'Makefile' created SHLOMIF/XML-LibXML-2.0119.tar.gz C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NOT OK – Venkatesh May 02 '15 at 12:20
  • Try x86 version from ActiveState's site – gangabass May 02 '15 at 12:33