Problems building XML::Parser on Win32, was Release: Camelbox

I changed the subject so as to break this out into it's own thread.

On Sun, Apr 20, 2008 at 8:42 PM, Daniel Kasak
<dkasak nusconsulting com au> wrote:
 I just installed in a VM and managed to get DBI built, but when I tried
 to build XML::Parser, it complained that I need expat installed. I tried
 installing a windows binary, but I assume that this is *not* the way to
 do it ( as it didn't work ). Do I have to build expat with included
 tools? Mingw? I haven't done this stuff before ...

There's an expat library there if you installed everything, Gnome
Canvas (or Gnome2::Canvas) uses it.

 I found a MinGW-5.1.3.exe that seems to be an installer, or updater, or
 something. What's going on?

MinGW is a copy of the GNU compiler suite for Windows, IIRC it's GCC
3.4.5 or thereabouts.  The MinGW-5.1.3.exe program is the installer;
the gcc/g++ binaries are already on the system and in your path if you
did a Full Install, you shouldn't need to do anything else to compile
modules (except tweak source code, more below).

Building Perl modules on Windows with my software package is similar
to doing it on *NIX, you just substitute 'dmake' wherever you would
normally use 'make', and things work.  GNU make can't handle
Windows-style paths apparently.

I got this to work, but it required some tweaking.  Short summary for
the impatient:

1) hack the Makefile.PL to look in the right place for the libexpat.dll binary
2) add the headers from the Expat distribution
3) tweak a Makefile after running 'perl Makefile.PL'

I went ahead and tried to install XML::Parser...

1) The Makefile.PL complains about not finding expat; the actual check is:

  if (!$found and $^O eq 'MSWin32') {
    if (-f 'C:/lib/Expat-2.0.0/Libs/libexpat.dll') {
      $expat_libpath = 'C:/lib/Expat-2.0.0/Libs';
      $expat_incpath = 'C:/lib/Expat-2.0.0/Source/lib';
      $found = 1;


which is not where expat is hiding on my (or your) system.  Change the
above file check to 'C:/camelbox/bin/libexpat.dll', and MakeMaker will
do it's thing.

which leads us to...

2) Add the headers from the Expat distribution.  The expat that I
included does not come with headers.  Mea culpa.  I'll put it on my
todo list.  I got a Windows package for expat from, installed it, swiped all of the
'*.h' header files from C:\Program Files\Expat 2.0.1\Source\lib and
stuffed them into C:\camelbox\include.

and ends us up with...

3) Tweaking the Makefile in the $XML_PARSER_SOURCE/Expat directory
(mine is C:\camelbox\.cpan\build\XML-Parser-2.36-XXXXXX\Expat).
Inside that Makefile there are two environment variables that are set
during the build, EXTRALIBS and LDLOADLIBS.  If you add the the full
path to libexpat.dll (C:\camelbox\bin\libexpat.dll) to the end of the
line for both of those environment variables, and then issue 'dmake'
from the top of the unpacked XML::Parser source directory, it should
then build without errors...

GTK2PERL-BUILD# perl -e "use XML::Parser;"

This is perl, v5.10.0 built for MSWin32-x86-multi-thread

Please let me know if the above instructions don't work for you.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]