simon.proctor has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to compile and install XML-LibXML-1.58 on my computer using VC.NET. This is to use the latest LibXML libraries under Perl 5.6.1 (build 638). Both my machine and the target machine are running windows 2000 and the idea is to package up this module for deployment onto the production server.

I'm having trouble getting the old perl Makefile.PL to run as it cannot find the libxml2 libraries. I have the dll and .lib files but am not sure how to reference them via the inc and libs arguments.

Could anyone point me in the right direction with respect to setting these values correctly and running Makefile.PL correctly?

I'm new to compiling under win32 (in case you couldn't guess) so apologies if this is blindingly obvious to you.

I'm using these urls as a reference:

A Practical Guide to Compiling C based Modules under ActiveState using Microsoft C++
gnome archive posting

Thanks,

SP

Replies are listed 'Best First'.
Re: Compiling LibXML on win32
by simon.proctor (Vicar) on Jun 03, 2004 at 09:40 UTC
    I have successfully gotten this working now and, so far, it is running without error (awaits segfault).

    To get this to work I copied the lib, dll and include files to the CORE directory in <dir>/perl/lib. I then had to edit perl-libxml-mm.c to get it to compile with cl.exe.

    I changed:
    xmlChar * decoded = PmmFastDecodeString( PmmNodeEncoding(real_doc) , ( xmlChar *)strin +g, ( xmlChar *)real_ +doc->encoding);
    to
    xmlChar *decoded; ...... decoded = PmmFastDecodeString( PmmNodeEncoding(real_doc) , ( xmlChar *)strin +g, ( xmlChar *)real_ +doc->encoding);
    I did get a few linker errors until I remembered to copy the zlib and iconv libs and headers into the core dir as well.

    All of the libs were downloaded from xmlsoft. The versions of everything I used are:
    • iconv-1.9.1-win32
    • libxml2-2.6.10.win32
    • zlib-1.1.4.win32
    • XML::LibXML 1.58
    I have packaged this up as a PPM and successfully installed it so I am most pleased.

    As I had to edit some of the XS code I am not ready to pass this around until I rigorously test it. The suite tests worked, however, so YYMV.