Perl XML :: LibXML Installation Error

I am trying to install the Perl XML :: LibXML module through CPAN, but I get the following error. I am using Windows 7 and Perl v5.16.1. I searched a lot, but did not get any solution.

What is the problem?

Set up gcc environment - 3.4.5 (mingw-vista special r3) 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 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. **No 'Makefile' created SHLOMIF/XML-LibXML-2.0014.tar.gz C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NOT OK** Running make test Make had some problems, won't test Running make install Make had some problems, won't install **Could not read metadata file. Falling back to other methods to determine prerequisites** Failed during this command: SHLOMIF/XML-LibXML-2.0014.tar.gz : writemakefile NO -- No 'Makefile' created 
+4
source share
3 answers

It is unclear which Perl distribution you are using. On Windows, it is easiest to use ActivePerl and its own ppm package manager (not CPAN).

On my Windows 7 machine, I was able to install XML::LibXML using this command without any problems:

 ppm install XML::LibXML 
+5
source

For ActivePerl on Windows, XML :: LibXML is no longer available through PPM due to the absence of dependencies that need to be installed manually.

Installing via CPAN is the right way, but you need to make sure libxml2 and its dependencies are present. They are required by XML :: LibXML.

The installation (taken from here , thanks to Rudy Rodriguez) is a long and winding road, but it works (Win 8.1, ActivePerl 5.20.1 x64):

  • Get the required binary package libxml2, iconv, zlib (all from here ) and gettext-tools .

  • Extract all the files into one directory (for example, C: \ perl_libxml \ merged) so that the files from the include, lib subdirectories, etc. in each zip file were extracted into one common directory include, lib, etc.

  • move the / libxml 2 / libxml folder one level up, i.e. in / libxml since this is the expected default directory

  • rename libz.a to zlib.a (in the lib directory)

  • install dependencies

     ppm install dmake MinGW XML::NamespaceSupport XML::SAX 
  • add c: \ perl_libxml \ merged \ bin in Windows PATH
  • change to the directory where the failed cpan build is located, for example. C: \ perl64 \ CPAN \ build \ XML-LibXML & lt; ...>
  • mileage:

     Makefile.PL INC=-IC:\perl_libxml\merged\include LIBS=-LC:\perl_libxml\merged\lib 

    Building a Makefile must be successful. If not, check if the LIBS and INC parameter points to the right directory

  •  dmake 

    If this fails, verify that your path entry is set correctly.

  •  dmake test 

    If the "dmake test" fails with cryptic errors, for example:

     load_file:%1 is not a valid Win32 application at C:/Perl64/lib/DynaLoader.pm line 191 

    it is possible that different versions of some libraries are present in your PATH and therefore linked at build time.

    I had another MinGW environment in my PATH that led to the linking of the wrong libraries. I could solve this by examining the built-in libxml.dll using the SDK- dependent tool for the Windows Server 2003 platform . You can see which DLL is used by libxml.dll and for which platform it was compiled. All of them must match and match your version of Perl, either x86 or x64.

  • If the tests succeed, finally install XML :: LibXML with

     dmake install 

Sidenote: I know this question is quite old, but I put this solution here as a link for others working on the same problem in the future (maybe I am one of them ...).

0
source

Install Strawberry Perl , it comes with XML :: LibXML and its dependencies.

0
source

All Articles