Tolkin, Steve
2004-03-07 14:41:56 UTC
Summary:
XML::SAX::Writer depends on Text::Iconv but I have been
unable to install this on Windows XP
despite trying three different ways.
1. The perl CPAN Iconv distribution is missing iconv.h,
so install Text::Iconv via CPAN fails.
2. I tried running ppm to download
a precompiled Iconv, but got a failure in ppm.bat.
(This might be the easiest fix.)
The ActiveState directory says that Iconv has status FAIL.
But http://theoryx5.uwinnipeg.ca/ppmpackages/ has
Text-Iconv.ppd 19-Dec-2003 00:50 418
Unfortunately this is just the metadata
and I cannot find the actual precompiled module.
3. I tried compiling the gnu programs libiconv and gettext
and got different failures there.
Or, is there any way to turn off this dependency, or
a different module that is similar but which does not have this
dependency.
Please help!
Details:
I am trying to follow the suggestion Kip made below (thanks Kip)
to use XML::SAX::Writer, but this depends on Text::Iconv.
My environment:
I am running perl 5.8.0 and MS VC 98 compiler and tools.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
My "shell" is just cmd.exe aka command prompt aka the plain old DOS box.
1. I try to install using: perl -MCPAN -e shell
When I say
install XML::SAX::Writer
everything is fine until it stops with:
---- Unsatisfied dependencies detected during
[R/RB/RBERJON/XML-SAX-Writer-0.44.
tar.gz] -----
Text::Iconv
Shall I follow them and prepend them to the queue
If I say yes it fails due to missing iconv.h, as follows
...
CPAN.pm: Going to build M/MP/MPIOTR/Text-Iconv-1.2.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for Text::Iconv
Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
cp Iconv.pm blib\lib\Text\Iconv.pm
AutoSplitting blib\lib\Text\Iconv.pm (blib\lib\auto\Text\Iconv)
C:\bin\perl.exe C:\Perl\lib\ExtUtils/xsubpp -typemap
C:\Perl\lib\ExtUti
ls\typemap -typemap typemap Iconv.xs > Iconv.xsc && C:\bin\perl.exe
-MExtUtils:
:Command -e mv Iconv.xsc Iconv.c
cl -c -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE
-DNO_ST
RICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-DUSE_PERLIO
-DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\"1.2\"
-DXS_VERSION=\"
1.2\" "-IC:\Perl\lib\CORE" Iconv.c
Iconv.c
Iconv.xs(15) : fatal error C1083: Cannot open include file: 'iconv.h': No
such f
ile or directory
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x2'
Stop.
C:\perl\bin\nmake.EXE -- NOT OK
Running make test
Can't test without successful make
2. Then I tried to get Iconv from the ppm shell
(which in this case is the ppm.bat file in my c:\perl\bin\).
But I hit this problem:
C:\TEMP>ppm
Can't locate XML/ValidatingElement.pm in @INC (@INC contains: c:/Perl/lib
c:/Per
l/site/lib .) at c:/Perl/site/lib/XML/PPD.pm line 8.
BEGIN failed--compilation aborted at c:/Perl/site/lib/XML/PPD.pm line 8.
It looks like it is off a level,
and/or my @INC needs to be modified. So I tried
cd \perl\site\lib\PPM
and then ran it again and got this error:
Can't locate object method "rvalidate" via package
"XML::PPMConfig::PPMCONFIG" a
t c:/Perl/site/lib/PPM.pm line 1620.
3. So I downloaded the gnu versions of libiconv and gettext and
followed the instructions in README.woe32 in libiconv and
successfully make libiconv using
nmake Makefile.msvc -NONLS=1
as stated in step 1.
Most of gettext compiled OK, but then it died,
whle trying to compile msgmerge.c (in gettest-tools/src/)
I think because of a problem in obstack.h.
the make ending with this:
/out:msgfmt.exe
msgfmt.obj
write-mo.obj
write-java.obj
write-csharp.obj
write-resources.obj
write-tcl.obj
write-qt.obj
plural-eval.obj
gettextsrc.lib
..\lib\gettextlib.lib
..\intl\intl.lib
c:\usr\lib\iconv.lib
cl -I. -I.. -I..\libuniname -I..\lib -I..\intl
-I..\..\gettext-runtime\i
ntl -I..\windows -Ic:\usr\include -W1 -D_NDEBUG -O1 -DHAVE_CONFIG_H
-DLOCALEDIR
=\"c:\\usr\\share\\locale\" -DLOCALE_ALIAS_PATH=\"\"
-DGETTEXTJAR=\"c:\\usr\\sha
re\\gettext\\gettext.jar\" -DLIBDIR=\"c:\\usr\\lib\"
-DGETTEXTDATADIR=\"c:\\usr\
\share\\gettext\" -DPROJECTSDIR=\"c:\\usr\\share\\gettext\\projects\"
-DINSTALLP
REFIX=\"c:\\usr\" -DINSTALLDIR=\"c:\\usr\\bin\" -c -Tp msgmerge.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
msgmerge.c
msgmerge.c(413) : warning C4508: 'main' : function should return a value;
'void'
return type assumed
msgmerge.c(677) : error C2660: '_obstack_begin' : function does not take 5
param
eters
msgmerge.c(693) : error C2660: '_obstack_newchunk' : function does not take
2 pa
rameters
msgmerge.c(722) : error C2660: '_obstack_newchunk' : function does not take
2 pa
rameters
msgmerge.c(752) : error C2660: '_obstack_newchunk' : function does not take
2 pa
rameters
msgmerge.c(782) : error C2660: '_obstack_newchunk' : function does not take
2 pa
rameters
msgmerge.c(824) : error C2660: '_obstack_free' : function does not take 2
parame
ters
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~3\VC98\BIN\NMAKE.EXE' :
return co
de '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~3\VC98\BIN\NMAKE.EXE' :
return co
de '0x2'
Stop.
But note that obstack.c did build succesfully.
(I do wonder why obstack.h is in the lib directory.)
Directory of C:\TEMP\gettext-0.14.1\gettext-tools\lib
11/05/2002 11:41 AM 19,711 obstack.c
08/24/2003 10:05 AM 23,630 obstack.h
03/07/2004 12:48 AM 3,104 obstack.obj
Thanks-in-advance-again-ly yours,
Steve
XML::SAX::Writer depends on Text::Iconv but I have been
unable to install this on Windows XP
despite trying three different ways.
1. The perl CPAN Iconv distribution is missing iconv.h,
so install Text::Iconv via CPAN fails.
2. I tried running ppm to download
a precompiled Iconv, but got a failure in ppm.bat.
(This might be the easiest fix.)
The ActiveState directory says that Iconv has status FAIL.
But http://theoryx5.uwinnipeg.ca/ppmpackages/ has
Text-Iconv.ppd 19-Dec-2003 00:50 418
Unfortunately this is just the metadata
and I cannot find the actual precompiled module.
3. I tried compiling the gnu programs libiconv and gettext
and got different failures there.
Or, is there any way to turn off this dependency, or
a different module that is similar but which does not have this
dependency.
Please help!
Details:
I am trying to follow the suggestion Kip made below (thanks Kip)
to use XML::SAX::Writer, but this depends on Text::Iconv.
My environment:
I am running perl 5.8.0 and MS VC 98 compiler and tools.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
My "shell" is just cmd.exe aka command prompt aka the plain old DOS box.
1. I try to install using: perl -MCPAN -e shell
When I say
install XML::SAX::Writer
everything is fine until it stops with:
---- Unsatisfied dependencies detected during
[R/RB/RBERJON/XML-SAX-Writer-0.44.
tar.gz] -----
Text::Iconv
Shall I follow them and prepend them to the queue
If I say yes it fails due to missing iconv.h, as follows
...
CPAN.pm: Going to build M/MP/MPIOTR/Text-Iconv-1.2.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for Text::Iconv
Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
cp Iconv.pm blib\lib\Text\Iconv.pm
AutoSplitting blib\lib\Text\Iconv.pm (blib\lib\auto\Text\Iconv)
C:\bin\perl.exe C:\Perl\lib\ExtUtils/xsubpp -typemap
C:\Perl\lib\ExtUti
ls\typemap -typemap typemap Iconv.xs > Iconv.xsc && C:\bin\perl.exe
-MExtUtils:
:Command -e mv Iconv.xsc Iconv.c
cl -c -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE
-DNO_ST
RICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-DUSE_PERLIO
-DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\"1.2\"
-DXS_VERSION=\"
1.2\" "-IC:\Perl\lib\CORE" Iconv.c
Iconv.c
Iconv.xs(15) : fatal error C1083: Cannot open include file: 'iconv.h': No
such f
ile or directory
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x2'
Stop.
C:\perl\bin\nmake.EXE -- NOT OK
Running make test
Can't test without successful make
2. Then I tried to get Iconv from the ppm shell
(which in this case is the ppm.bat file in my c:\perl\bin\).
But I hit this problem:
C:\TEMP>ppm
Can't locate XML/ValidatingElement.pm in @INC (@INC contains: c:/Perl/lib
c:/Per
l/site/lib .) at c:/Perl/site/lib/XML/PPD.pm line 8.
BEGIN failed--compilation aborted at c:/Perl/site/lib/XML/PPD.pm line 8.
It looks like it is off a level,
and/or my @INC needs to be modified. So I tried
cd \perl\site\lib\PPM
and then ran it again and got this error:
Can't locate object method "rvalidate" via package
"XML::PPMConfig::PPMCONFIG" a
t c:/Perl/site/lib/PPM.pm line 1620.
3. So I downloaded the gnu versions of libiconv and gettext and
followed the instructions in README.woe32 in libiconv and
successfully make libiconv using
nmake Makefile.msvc -NONLS=1
as stated in step 1.
Most of gettext compiled OK, but then it died,
whle trying to compile msgmerge.c (in gettest-tools/src/)
I think because of a problem in obstack.h.
the make ending with this:
/out:msgfmt.exe
msgfmt.obj
write-mo.obj
write-java.obj
write-csharp.obj
write-resources.obj
write-tcl.obj
write-qt.obj
plural-eval.obj
gettextsrc.lib
..\lib\gettextlib.lib
..\intl\intl.lib
c:\usr\lib\iconv.lib
cl -I. -I.. -I..\libuniname -I..\lib -I..\intl
-I..\..\gettext-runtime\i
ntl -I..\windows -Ic:\usr\include -W1 -D_NDEBUG -O1 -DHAVE_CONFIG_H
-DLOCALEDIR
=\"c:\\usr\\share\\locale\" -DLOCALE_ALIAS_PATH=\"\"
-DGETTEXTJAR=\"c:\\usr\\sha
re\\gettext\\gettext.jar\" -DLIBDIR=\"c:\\usr\\lib\"
-DGETTEXTDATADIR=\"c:\\usr\
\share\\gettext\" -DPROJECTSDIR=\"c:\\usr\\share\\gettext\\projects\"
-DINSTALLP
REFIX=\"c:\\usr\" -DINSTALLDIR=\"c:\\usr\\bin\" -c -Tp msgmerge.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
msgmerge.c
msgmerge.c(413) : warning C4508: 'main' : function should return a value;
'void'
return type assumed
msgmerge.c(677) : error C2660: '_obstack_begin' : function does not take 5
param
eters
msgmerge.c(693) : error C2660: '_obstack_newchunk' : function does not take
2 pa
rameters
msgmerge.c(722) : error C2660: '_obstack_newchunk' : function does not take
2 pa
rameters
msgmerge.c(752) : error C2660: '_obstack_newchunk' : function does not take
2 pa
rameters
msgmerge.c(782) : error C2660: '_obstack_newchunk' : function does not take
2 pa
rameters
msgmerge.c(824) : error C2660: '_obstack_free' : function does not take 2
parame
ters
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~3\VC98\BIN\NMAKE.EXE' :
return co
de '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~3\VC98\BIN\NMAKE.EXE' :
return co
de '0x2'
Stop.
But note that obstack.c did build succesfully.
(I do wonder why obstack.h is in the lib directory.)
Directory of C:\TEMP\gettext-0.14.1\gettext-tools\lib
11/05/2002 11:41 AM 19,711 obstack.c
08/24/2003 10:05 AM 23,630 obstack.h
03/07/2004 12:48 AM 3,104 obstack.obj
Thanks-in-advance-again-ly yours,
Steve
-----Original Message-----
Sent: Sunday, March 07, 2004 3:07 AM
To: Tolkin, Steve
Subject: Re: Parsing a record oriented file into XML
<snip/>
Perl data
structures) and connect it up to any SAX2 Writer.
use XML::Generator::PerlData;
use XML::SAX::Writer;
my $writer = XML::SAX::Writer->new();
my $generator = XML::Generator::PelData->new( Handler =? $writer );
open(FH, "your.wacky.file") || die "Nope: $!";
$generator->parse_starr();
while (<FH>) {
# process and munge each line from the
# file into some perl data structure--
my $hash_ref = process_record($_);
$generator->parse_chunk( $hash_ref );
}
$generator->parse_end();
close FH;
That's it. Generator::PerlData also offers a ton of options
to control
how your data gets translated; check out the perldoc for details.
Cheers,
-kip
Sent: Sunday, March 07, 2004 3:07 AM
To: Tolkin, Steve
Subject: Re: Parsing a record oriented file into XML
<snip/>
Kip Hampton's 2001 article "Writing SAX Drivers for Non-XML Data"
_http://www.xml.com/lpt/a/2001/09/19/sax-non-xml-data.html_
suggests a general technique, but there does not seem to be
a module_http://www.xml.com/lpt/a/2001/09/19/sax-non-xml-data.html_
suggests a general technique, but there does not seem to be
that does this.
Try XML::Generator::PerlData (that generates SAX2 events fromPerl data
structures) and connect it up to any SAX2 Writer.
use XML::Generator::PerlData;
use XML::SAX::Writer;
my $writer = XML::SAX::Writer->new();
my $generator = XML::Generator::PelData->new( Handler =? $writer );
open(FH, "your.wacky.file") || die "Nope: $!";
$generator->parse_starr();
while (<FH>) {
# process and munge each line from the
# file into some perl data structure--
my $hash_ref = process_record($_);
$generator->parse_chunk( $hash_ref );
}
$generator->parse_end();
close FH;
That's it. Generator::PerlData also offers a ton of options
to control
how your data gets translated; check out the perldoc for details.
Cheers,
-kip