nyet
nyet

Reputation: 83

Why can't cpan install XML::LibXML?

This is really weird, can someone explain why GCC can not find an include file when installing XML::LibXML?

> cpan PAJAS/XML-LibXML-1.70.tar.gz
...
C:/CPANTE~1/PERL51~1.0_6/site/bin/gcc.exe -c    -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"1.70\" -DXS_VERSION=\"1.70\"  "-IC:\CPANTesters\Perl5.16.0_64\lib\CORE"  -DHAVE_UTF8 -DHAVE_BLANK LibXML.c
LibXML.xs:34:31: fatal error: libxml/xmlversion.h: No such file or directory

> IF EXIST %INCLUDE%\libxml\xmlversion.h ECHO Cogito ergo sum
Cogito ergo sum

This is ActiveState 5.16.0 64 bit with MinGW64.

I decide to drop using Zlatkovic Win32 binaries ftp://ftp.zlatkovic.com/pub/libxml/, and use the 64 bit binaries available at http://ftp.gnome.org/pub/GNOME/binaries/win64/dependencies/.

The problem above is solved by going to the unpacked module and execute this command:

> perl Makefile.PL INC=-IC:\CPANTesters\bin\gnome-deps-win64\include LIBS=-LC:\CPANTesters\bin\gnome-deps-win64\lib
> dmake 

But problem arises from running dmake test since Perl crashes on all test files.

C:\CPANTesters\Perl5.16.0_64\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/01basic.t ......................... Dubious, test returned 38 (wstat 9728, 0x2600)
Failed 3/3 subtests

Any idea on how to debug this?

Upvotes: 0

Views: 4300

Answers (3)

Christian Quirós
Christian Quirós

Reputation: 504

try this, it worked for me on centos 6, after doing this I was able to install via CPANM other modules relying on XML::LibXML https://www.question-defense.com/2010/01/27/perl-cpan-install-xmllibxmlcommon-error-libxml2-not-found

Upvotes: -1

ekawas
ekawas

Reputation: 6654

Usually, on windows, the easiest thing is to use a repository that has built LibXML for you. This question is similar to yours: Is XML::LibXML not supported on Perl 5.8.8?

Upvotes: 0

cjm
cjm

Reputation: 62099

XML-LibXML is a Perl binding for libxml2, but it does not include a copy of libxml2 (of which libxml/xmlversion.h is a part). You must install that separately, and make sure Perl and gcc can find it. INCLUDE is not an environment variable used by gcc. It uses CPATH or C_INCLUDE_PATH.

I contributed instructions for installing XML-LibXML from source on Microsoft Windows. Did you try following them?

The easiest way to get XML-LibXML on Windows is to install Strawberry Perl. It comes with XML-LibXML in the package.

Upvotes: 3

Related Questions