Reputation: 915
I'm trying to install Perl XML::LibXML module through CPAN but getting the following error. I'm using Windows 7 machine and Perl v5.16.1. I did lot of search but didn't get any solution.
What should be 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
Upvotes: 4
Views: 5179
Reputation: 11158
Install Strawberry Perl, it comes with XML::LibXML and its dependencies built-in.
Upvotes: 0
Reputation: 11
For ActivePerl on Windows, XML::LibXML is not available through PPM anymore due to missing dependencies which must be manually installed.
Installing through 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 of libxml2, iconv, zlib (all from here) and gettext-tools.
Extract all files into the same directory (e.g. C:\perl_libxml\merged) so that files in the include, lib etc. subdirectories within each zip file are extracted to one common include, lib etc. directory
move the /libxml2/libxml folder one level up, i.e. to /libxml, as this is the expected default directory
rename libz.a to zlib.a (in the lib dir)
install the dependencies
ppm install dmake MinGW XML::NamespaceSupport XML::SAX
run:
Makefile.PL INC=-IC:\perl_libxml\merged\include LIBS=-LC:\perl_libxml\merged\lib
The build of the Makefile should succeed. If not, check if the LIBS and INC parameter point to the right directory
dmake
If this fails, check if your path entry is properly set
dmake test
If 'dmake test' fails with cryptic errors like:
load_file:%1 is not a valid Win32 application at C:/Perl64/lib/DynaLoader.pm line 191
it may be that different versions of some of the libraries are present in your PATH and therefore linked during build.
I had another MinGW environment in my PATH leading to a linking of the wrong libs. I could resolve it by examining the built libxml.dll with the 'depends' tool from Windows Server 2003 platform SDK. You can see which DLL is used by libxml.dll and what platform is was compiled for. All of these must match and also match your Perl version, either x86 or x64.
If the tests succeeds, finally install XML::LibXML with
dmake install
Sidenote: I know this question is quite old but I put this solution here as a reference for others running into the same issue in the future (maybe me being one of them...).
Upvotes: 0
Reputation: 116028
It is not clear which Perl distribution you are using. On Windows, it is easiest to use ActivePerl and its native package manager ppm
(not CPAN).
On my Windows 7 machine, I was able to install XML::LibXML
without any problem using this command:
ppm install XML::LibXML
Upvotes: 5