Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

use XML::LibXML; is causing compile error

by willjones (Sexton)
on Aug 21, 2008 at 05:08 UTC ( #705707=perlquestion: print w/replies, xml ) Need Help??

willjones has asked for the wisdom of the Perl Monks concerning the following question:

I found this post when searching for info on my problem, but although the error message is the same my situation is a little different.

I am getting a compile error in Eclipse when I try to use XML::LibXML. I have installed this package with PPM and I am running with ActiveState on a Windows box. It was my understanding that PPM would handle pulling in any dependencies necessary automatically when I selected XML-LibXML for install.

The error message I receive is:
Compilation failed in require
A fatal error (trappable)
Perl could not compile a file specified in a C<require> statement.
Perl uses this generic message when none of the errors that it
encountered were severe enough to halt compilation immediately.

Any ideas what I am doing wrong?

Here's what's showing in the Details tab when I click on my installed XML-LibXML package in PPM...

XML-LibXML Interface to Gnome libxml2 xml parsing and DOM library Version: 1.66 Author: Christian Glahn CPAN: Installed files: C:/Perl/html/site/lib/XML/LibXML.html C:/Perl/html/site/lib/XML/LibXML/Attr.html C:/Perl/html/site/lib/XML/LibXML/Boolean.html C:/Perl/html/site/lib/XML/LibXML/CDATASection.html C:/Perl/html/site/lib/XML/LibXML/Comment.html C:/Perl/html/site/lib/XML/LibXML/DOM.html C:/Perl/html/site/lib/XML/LibXML/Document.html C:/Perl/html/site/lib/XML/LibXML/DocumentFragment.html C:/Perl/html/site/lib/XML/LibXML/Dtd.html C:/Perl/html/site/lib/XML/LibXML/Element.html C:/Perl/html/site/lib/XML/LibXML/InputCallback.html C:/Perl/html/site/lib/XML/LibXML/Literal.html C:/Perl/html/site/lib/XML/LibXML/Namespace.html C:/Perl/html/site/lib/XML/LibXML/Node.html C:/Perl/html/site/lib/XML/LibXML/NodeList.html C:/Perl/html/site/lib/XML/LibXML/Number.html C:/Perl/html/site/lib/XML/LibXML/PI.html C:/Perl/html/site/lib/XML/LibXML/Parser.html C:/Perl/html/site/lib/XML/LibXML/Reader.html C:/Perl/html/site/lib/XML/LibXML/RelaxNG.html C:/Perl/html/site/lib/XML/LibXML/SAX.html C:/Perl/html/site/lib/XML/LibXML/SAX/Builder.html C:/Perl/html/site/lib/XML/LibXML/SAX/Generator.html C:/Perl/html/site/lib/XML/LibXML/Schema.html C:/Perl/html/site/lib/XML/LibXML/Text.html C:/Perl/html/site/lib/XML/LibXML/XPathContext.html C:/Perl/site/lib/XML/ C:/Perl/site/lib/XML/LibXML.pod C:/Perl/site/lib/XML/LibXML/Attr.pod C:/Perl/site/lib/XML/LibXML/ C:/Perl/site/lib/XML/LibXML/CDATASection.pod C:/Perl/site/lib/XML/LibXML/Comment.pod C:/Perl/site/lib/XML/LibXML/DOM.pod C:/Perl/site/lib/XML/LibXML/Document.pod C:/Perl/site/lib/XML/LibXML/DocumentFragment.pod C:/Perl/site/lib/XML/LibXML/Dtd.pod C:/Perl/site/lib/XML/LibXML/Element.pod C:/Perl/site/lib/XML/LibXML/InputCallback.pod C:/Perl/site/lib/XML/LibXML/ C:/Perl/site/lib/XML/LibXML/Namespace.pod C:/Perl/site/lib/XML/LibXML/Node.pod C:/Perl/site/lib/XML/LibXML/ C:/Perl/site/lib/XML/LibXML/ C:/Perl/site/lib/XML/LibXML/PI.pod C:/Perl/site/lib/XML/LibXML/Parser.pod C:/Perl/site/lib/XML/LibXML/ C:/Perl/site/lib/XML/LibXML/Reader.pod C:/Perl/site/lib/XML/LibXML/RelaxNG.pod C:/Perl/site/lib/XML/LibXML/ C:/Perl/site/lib/XML/LibXML/SAX.pod C:/Perl/site/lib/XML/LibXML/SAX/ C:/Perl/site/lib/XML/LibXML/SAX/Builder.pod C:/Perl/site/lib/XML/LibXML/SAX/ C:/Perl/site/lib/XML/LibXML/SAX/ C:/Perl/site/lib/XML/LibXML/Schema.pod C:/Perl/site/lib/XML/LibXML/Text.pod C:/Perl/site/lib/XML/LibXML/ C:/Perl/site/lib/XML/LibXML/XPathContext.pod C:/Perl/site/lib/auto/XML/LibXML/.packlist C:/Perl/site/lib/auto/XML/LibXML/ C:/Perl/site/lib/auto/XML/LibXML/LibXML.dll C:/Perl/site/lib/auto/XML/LibXML/LibXML.exp C:/Perl/site/lib/auto/XML/LibXML/LibXML.lib C:/Perl/site/lib/auto/XML/LibXML/LibXML.pdb

Thanks for any help on this...

Replies are listed 'Best First'.
Re: use XML::LibXML; is causing compile error
by dHarry (Abbot) on Aug 21, 2008 at 08:01 UTC

    I tried it myself this morning.

    Only code:

    use XML::LibXML;

    Can't locate XML/LibXML/ in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at :/Perl/site/lib/XML/ line 12. BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/ line 12. Compilation failed in require at line 3. BEGIN failed--compilation aborted at line 3.

    This is the line in that causes the error:
    use XML::LibXML::Common qw(:encoding :libxml);
    Which is not surprising of course. I looked in C:\Perl\site\lib\XML\LibXML and the is (of course) missing. Apparently the ppm package for Win32 from ActiveState is flawed.

    Next I installed the ppm for Common separately. This took care of the problem.... but then the next problem popped up:-(


    Code used (taken from the pod)

    Error message: Can't locate object method "toFh" via package "XML::LibXML::Document". Which makes a lot of sense since the sub is not in where it should be. This wrong as it was added in v1.53 and my version is 1.66.

    The ppm package from ActiveState is buggy. As an alternative you can try build it from the CPAN distribution or find another Win32 ppm package for it.

    Update 2

    Submitted the bug to ActiveState.

    Update 3

    I tried the trouchelle ppm package. First you have to install Common separately because it's not present on trouchelle. The code above gives the following error message:

    So now we're back at Problems installing XML::LibXML for Perl5.10 on Win32 platform with the remark that it's the same s*** for Per5.8.8.

      The ppm package from ActiveState is buggy. As an alternative you can try build it from the CPAN distribution or find another Win32 ppm package for it.

      1. I'd notify ActiveState. 2. lists

      Win32 PPM packages for "XML-LibXML" Perl 5.8 repository [ v 1.66 ] Perl 5.8 repository [ v 1.66 ] uwinnipeg Perl 5.10 repository [ v 1.65 ] uwinnipeg Perl 5.6 repository [ v 1.64 ] uwinnipeg Perl 5.8 repository [ v 1.64 ]
      I tried the trouchelle ppm package

      Did you try the versions at the uwinnipeg reps (1.65 for perl-5.10, 1.64 for perl-5.8) ?

Re: use XML::LibXML; is causing compile error
by Corion (Pope) on Aug 21, 2008 at 06:11 UTC

    Show us your code. Especially the line with the require in it. Also, Perl is usually more informative about its errors than what you transcribed - Perl tells you what file it tried to require, and which line number that happened.

    If you really, really think that this happens on a line use XML::LibXML; or require XML::LibXML;, then likely, XML::LibXML is not installed for whatever Perl Eclipse runs.

Re: use XML::LibXML; is causing compile error
by Anonymous Monk on Aug 21, 2008 at 06:06 UTC
    Any ideas what I am doing wrong?

    You need to narrow down the cause, find a more specific error message. Check in the "Event Viewer" under Application, or use Devel::Trace or try to reproduce the error outside of Eclipse. Another thing, since you're in Eclipse, you could try their support forum.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://705707]
Approved by GrandFather
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2020-04-06 12:39 GMT
Find Nodes?
    Voting Booth?
    The most amusing oxymoron is:

    Results (39 votes). Check out past polls.