Here's a very short sample showing correct compilation against libxml2 on CentOS 6:

$ wget http://www.xmlsoft.org/examples/io2.c --2017-05-31 15:13:18-- http://www.xmlsoft.org/examples/io2.c Resolving www.xmlsoft.org... 91.121.203.120 Connecting to www.xmlsoft.org|91.121.203.120|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1182 (1.2K) [text/plain] Saving to: `io2.c' 100%[======================================>] 1,182 --.-K/s in + 0s 2017-05-31 15:13:18 (53.9 MB/s) - `io2.c' saved [1182/1182] $ gcc -o xmltest -I/usr/include/libxml2 -lxml2 -lz -lm io2.c $ ./xmltest <?xml version="1.0"?> <root>content</root> $

If you get the same then the problem is likely to be on the cpan side. But if you get something different then it isn't a perl problem at all and you'll need to fix your libxml2 installation.


In reply to Re^7: cpan install error for XML::LibXML::Node by hippo
in thread cpan install error for XML::LibXML::Node by BradV

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.