laleh-poly has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I have some problem regarding installing XML::LibXML. I have already installed libxml2 and gcc. When I run the “make” command I get the following error:
gcc -c -I/usr/include/libxml2 -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI_ +_ -fno-str ict-aliasing -pipe -I/usr/local/include -DUSEIMPORTLIB -O3 -DVERSION +=\"1.70\" -DXS_VERSION=\"1.70\" "-I/usr/lib/perl5/5.10/i686-cygwin/CORE" -DHAV +E_UTF8 -DH AVE_BLANK Av_CharPtrPtr.c /usr/bin/perl.exe /usr/lib/perl5/5.10/ExtUtils/xsubpp -typemap /usr/l +ib/perl5/5 .10/ExtUtils/typemap -typemap typemap LibXML.xs > LibXML.xsc && mv Li +bXML.xsc L ibXML.c Can't find typemap in /cygdrive/c/Perl/lib/XML-LibXML-1.70 make: *** [LibXML.c] Error 255
I have read a solution posted on: http://aspn.activestate.com/ASPN/Mail/Message/perl-xml/3687924. But as I mentioned I have already installed libxml2 and gcc. The typemap file is in the directory "c/Perl/lib/XML-LibXML-1.70" and I cannot understand why it cannot find it. Even when I try to install XML::LibXML::Common 0.13 I get exactly the same error as above regarding typemap. I read on the following page: http://www.brandonhutchinson.com/installing_perl_modules.html that “Note: you should use the same compiler to build Perl modules that you used to build Perl. For example, if you are building Perl modules with gcc and are using a version of Perl that was supplied with your distribution (ex. Solaris 8 includes Perl 5.005_03), you may run into errors.” Could this be related to me? If yes how can I solve it. Thanks, Laleh

Replies are listed 'Best First'.
Re: XML::LibXML installation problem
by syphilis (Archbishop) on Dec 24, 2009 at 23:07 UTC
    If this is Cygwin, I had a very similar problem until someone suggested setting the CYGWIN environment variable to nontsec. Once that environment variable was set to that value, the problem went away. I think another solution was to place the module source within the Cygwin tree, somewhere below "~" .

    I could be mistaken, but it seems that you've placed the XML-LibXML-1.70 source inside a perl installation. That's not a good idea (though it won't necessarily break anything). Best to put the sources somewhere separate - eg C:/builds or ~/builds or somesuch.

    Cheers,
    Rob
Re: XML::LibXML installation problem
by laleh-poly (Novice) on Dec 24, 2009 at 23:48 UTC
    Hi Rob, Thanks for your very fast response on Christmas Eve. I did copy the XML::LibXML under Cygwin directory "c:\Cygwin\XML-LibXML" and I tried to install it again, but I received the same error. Regarding changing the Cygwin environment variable, could you please explain more. How can I change the environment variable? Thanks again and Merry Christmas!! Laleh
      I did copy the XML::LibXML under Cygwin directory "c:\Cygwin\XML-LibXML"

      I think you have to place it under the "~" directory - ie under "C:\Cygwin\home\your_username\" for that to work. But I could be wrong about that.

      Anyway, I'm pleased that it's now working for you :-)

      Cheers,
      Rob
      Hi Rob, Thanks a lot, I did changed the Cygwin environment variable exactly as you mentioned, and ..... WOW it worked. THANKS A LOT.