We help IT Professionals succeed at work.

Getting LibXML2 and perl XML::LibXML working on Windows XP

jetbet
jetbet asked
on
2,837 Views
Last Modified: 2012-06-21
I want to add the following the XML::LibXML perl package to a Windows XP VMWare Virtual Machine.
My perl version is ActivePerl-5.8.8.822.
I have both PPM and CPAN available on the command line.
I have installed the package via CPAN but it will not build due to LibXML2 not being found.
I have been to http://xmlsoft.org/ to get instructions and downloaded the windows binarys from http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/" and tried to install them.

I have added LibXML2.dll to my system32 folder.
I have created a folder called c:\toolkit, added everything from the bin directory to it and added this to by path variable.
I have called install with LIBS and INC set to my toolkit directory from the CPAN command line.

Although the installation process complained about not being able to find xml2 and libxml2 the LibXML package is installed in my perl\site\lib\XML directory. When I try to run a perl scriprt that was working on an old Windows NT VM (I am upgrading to Windows XP but keeping the same scripts) it complains about XML::LibXML::Common.pm not being there.

Installing this by hand gets me the following message;
****************************************************************************************
"Can't locate loadable object for module XML::LibXML::Common in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/site/lib/XML/"
******************************************************************************************

Trying to install Common via CPAN gives me the following error
****************************************************************************************
  CPAN.pm: Going to build P/PH/PHISH/XML-LibXML-Common-0.13.tar.gz

enable native perl UTF8
looking for -lxml2... no
looking for -llibxml2... no
libxml2 not found
Try setting LIBS and INC values on the command line
Or get libxml2 from
  http://www.libxml.org/
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.
Warning: No success on command[C:\Perl\bin\perl.exe Makefile.PL]
Warning (usually harmless): 'YAML' not installed, will not store persistent state
  PHISH/XML-LibXML-Common-0.13.tar.gz
  C:\Perl\bin\perl.exe Makefile.PL -- NOT OK
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install
Failed during this command:
 PHISH/XML-LibXML-Common-0.13.tar.gz          : writemakefile NO 'C:\Perl\bin\perl.exe Makefile.PL' returned status 512
*******************************************************************************************************************

I have tried downloading NMake and running that, I have looked inside the CPAN perl scripts for what search paths are being used......

Nothing seems to work.

Does anyone know how to get Perl modules with dependencies like this working in windows?
 Everything I have tried seems to point at being on a *nix machine or being a C programmer.

Thanks  
Comment
Watch Question

Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Not for points but the commands to do what mcjoyne is suggesting:

   ppm repo add http://theoryx5.uwinnipeg.ca/ppms

   ppm install XML-LibXML


It looks like this:

C:\Documents and Settings\Mark>ppm repo add http://theoryx5.uwinnipeg.ca/ppms
Downloading theoryx5.uwinnipeg.ca packlist...done
Updating theoryx5.uwinnipeg.ca database...done
Repo 3 added.

C:\Documents and Settings\Mark>ppm install XML-LibXML
Downloading XML-LibXML-1.63...done
Downloading XML-SAX-0.16...done
Downloading XML-NamespaceSupport-1.09...done
Downloading XML-LibXML-Common-0.13...done
Unpacking XML-LibXML-1.63...done
Unpacking XML-SAX-0.16...done
Unpacking XML-NamespaceSupport-1.09...done
Unpacking XML-LibXML-Common-0.13...done
Generating HTML for XML-LibXML-1.63...done
Generating HTML for XML-SAX-0.16...done
Generating HTML for XML-NamespaceSupport-1.09...done
Generating HTML for XML-LibXML-Common-0.13...done
Updating files in site area...done
Downloading XML-LibXML-Common-0.13 install script...done
Running XML-LibXML-Common-0.13 install script...
The library libxml2.dll is needed to complete the installation,
and should be placed in a directory somewhere in your PATH
environment variable. I can fetch and install this for you,
if you don't already have it.

Fetch libxml2.dll? [yes]
Fetching http://theoryx5.uwinnipeg.ca/ppms/scripts/libxml2.dll ...  done!
Where should libxml2.dll be placed? [C:\Perl\bin]
libxml2.dll has been successfully installed to C:/Perl/bin
done
Downloading XML-LibXML-1.63 install script...done
Running XML-LibXML-1.63 install script...
Do you want to alter ParserDetails.ini? [yes]
C:\Perl\bin\perl.exe -MXML::SAX -e "XML::SAX->add_parser(q(XML::LibXML::SAX::Par
ser))->save_parsers()"
C:\Perl\bin\perl.exe -MXML::SAX -e "XML::SAX->add_parser(q(XML::LibXML::SAX))->s
ave_parsers()"
done
 103 files installed

Commented:
Or you can just do:

C:\>ppm install http://theoryx5.uwinnipeg.ca/ppms/XML-LibXML

if you don't feel like adding the U Winnipeg repository to your list, but it is a very good repository for Windows PPMs, along with the Bribes repository (http://www.bribes.org/perl/ppm) and the Roth Consulting repository (http://www.roth.net/perl/packages/).  I always add all three to all my Windows machines.

Author

Commented:
Great,
I had been to the site but not added it to my repository and so did not realise it was available from there. The only package I had found there was LibXML-Perl. When I tried using that I had an error that it was still looking for LibXML as it appeared to ignore the '-' and everything after it.

PPM is a lot more freindly than CPAN by the looks of it as it downloaded the prerequisites as well.

The perl module is now loading fine and all I need to do is find out how to get rid of the perl.exe error box with the error
"The procedure entry point xmlCtxGetLastError could not be located in the dynamic link library libxml2.dll"

Do you have any idea, I am quite happy to start from scratch with my install if I have screwed something up with my previous attempts at install.

Author

Commented:
I will try reinstalling perl from scratch.
I get the following error when I close the error box;

Can't load 'C:/Perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML: load_file:The specified procedure could not be found at C:/
Perl/lib/DynaLoader.pm line 229.
 at C:/Perl/site/lib/XML/LibXML.pm line 116
BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/LibXML.pm line 116.
Compilation failed in require at C:\TestFramework\trunk\jeriServer.pl line 7.
BEGIN failed--compilation aborted at C:\TestFramework\trunk\jeriServer.pl line 7.

Thanks for all your help

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.