Dear group,

This is relevant to all those that might be contemplating a dabble with XML in Perl.
This is the target architecture:
MS-Win2K Professional
Active-Perl 5.10 Build 1002

The mission is to get XML::LibXML installed and running on the target mentioned above. Steps I followed:

Kindly Note: The PPM approach did not work, so please do not recommend that option to me. Our company firewall blocks online installs and offline install does not work either. I am presently communicating with Randy Kobes, ye good man that hails from Winnipeg, on this matter for sometime now. We are pretty much scraping the bottom of the barrel on PPM installs.

1. Installed the libxml2, iconv and zlibc libraries for Win32 from _the_ popular source: http://www.zlatkovic.com/libxml.en.html -> and links from therein for the other sources.
2. The MakeMaker is unable to identify the libxml2 installation, so modify the Makefile.PL to disable all validations for lib*xml*. Then generate the Makefile with the usual magic incantations.

MY_HOME:> perl makefile.PL INC="-IC:\Perl\lib\libxml2\include -IC: +\Progra~1\Micros~3\VC98\Include -IC:\Progra~1\GnuWin32\include" LIBS= +"-LC:\Perl\lib\libxml2\lib -LC:\Progra~1\GnuWin32\lib"
This is the only way that one can generate the Makefile proper.
3. Then, manually add many of the lib files needed for a successful make into the $EXTRALIBS and $LDLOADLIBS vars. Some examples:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi +32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
There are more!
4. Now run nmake and nmake install.
5. For the XML-Common package, steps 2 and 3 yield the appropriate results. The files are also copied into the relevant areas.
6. For XML-LibXML, step 3 fails with the following error: Here follows a portion of the nmake output follows: Please read through it for my annotations
/****** Lots of other details go here ******/ Running Mkbootstrap for XML::LibXML () C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 644 LibXML.bs li +nk -out:blib\arch\auto\XML\LibXML\LibXML.dll -dll -nologo ^^^^^^^^^^^^^A new libXML is getting created^^^^^^^^^^^^^ -nodefaultlib -debug -opt:ref,icf -libpath:"C:\Perl\lib\CORE" -m +achine:x86 Av_CharPtrPtr.obj LibXML.obj dom.obj perl-libxml-mm.obj + perl-libxml-sax.obj xpath.obj C:\Perl\lib\CORE\perl510.lib C:\Pe +rl\lib\libxml2\lib\libxml2.lib ^^^^^^^^^^^^^^^^^^Inclusion of library here!^^^^^^^ C:\PROGRA~1\MICROS~3\VC98\LIB\oldnames.lib C:\PROGRA~1\MICROS~3\VC98\L +IB\kernel32.lib /****** Lots of other details go here ******/
7. further, "nmake install" leads to another FATAL error. A dialog box pops up with message: "xmltestReaderSetSchema could not be found in libxml2.dll" - meaning libxml2 was looked up, but not loaded or vice versa. From here, it is downhill all the way!
8. A sample program to test if the library is installed and invoked successfully, leads to this error:

> "C:\Perl\bin\perl5.10.0.exe" Part3a.pl Can't load 'C:/Perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XM +L::LibXML: load_file:The specified procedure could not be found at C: +/Perl/lib/DynaLoader.pm line 201. at C:/Perl/site/lib/XML/LibXML.pm line 116 BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/LibXML.pm li +ne 116. Compilation failed in require at RosieStock.pm line 3. BEGIN failed--compilation aborted at RosieStock.pm line 3. Compilation failed in require at Part3a.pl line 4. BEGIN failed--compilation aborted at Part3a.pl line 4. > Terminated with exit code 9.

As you can see. it is like running on a Hamster wheel! All work and no play, yields us no package :-(.
Any constructive suggestions and inputs from anybody on this matter is more than welcome and will be greatly appreciated. If someone wishes to add to this, that will be of use for me as well. If you need more data, please ask and I will be happy to add them in subsequent threads.

Many thanks if you have read this far. Thank you all even more, should you decide to reply to this post.

Best wishes,
Suresh.

Updates for original post: June 10, 2008

Thanks for all your suggestions to the post and in the chat session earlier: Here's the outcome of the suggestions

1. Upon searching, I found multiple instances of "libxml2.dll" on the PC. Edited the PATH variable to reflect only the one path containing libxml2.dll.
Unfortunately this attempt also did not work, and we got the same old error of:  Can't load 'C:/Perl/site/lib/auto/XML/LibXML/LibXML.dll' or Common.dll depending on the PC where the exercise was being conducted.

2a. XML::LibXML and the libxml2.dll ship (as standard) with the latest Strawberry Perl.
As per Rob's suggestion - installed Strawberry Perl and tried to run a test script. Still no joy and the same error is being encountered

Can't load 'D:/Strawberry/Perl/site/lib/auto/XML/LibXML/LibXML.dll' fo +r module XML::LibXML: load_file:The specified procedure could not be +found at D:/Strawberry/Perl/lib/DynaLoader.pm line 201. at D:/Strawberry/Perl/site/lib/XML/LibXML.pm line 116 BEGIN failed--compilation aborted at D:/Strawberry/Perl/site/lib/XML/L +ibXML.pm line 116.

On another test PC, the same test bails out with errors encountered in Common.dll itself!.

2b.Assuming strawberry has been placed in it's default location, run:
set PATH=C:\strawberry\c\bin;%PATH%
As per the second suggestion, re-edited the PATH variable and added only the strawberry paths first. This resulted in script failing due to the dependency on LibXSLT. Managed to get that installed on the activeState Perl installation after a lot of callisthenics! We reasoned that if after we get this sorted, it is a simple matter of copying the necessary files back into strawberry/ActiveState as the need arises.
But, after installing LibXSLT in ActivePerl, even Strawberry perl started throwing up the error that was being throw originally, i.e.,  Can't load..........   LibXML.dll! (God! What a truly unholy mess this is turning out to be!)

3. Apologies for mis-typing "xmlTextReaderSetSchema" in the first post. That was helpful for the search, but editing the paths and including only the relevant path for libxml2 did not help.

4. I am aware of the http_proxy variable and I have already set it up on my PC. In spite of giving full path, ppm reports the 404...not found error!

Still in square one and still in bad shape. Anyone else got lucky with LibXML on a 5.10 install? Would you be willing to share your knowledge with us, please?

#---- [EOF] --------------- [EOF]-----------------------

In reply to Problems installing XML::LibXML for Perl5.10 on Win32 platform by jey_suresh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.