VGR has asked for the wisdom of the Perl Monks concerning the following question:

Hi i tried installing the data::dumper module from CPAN onto cygwin...
It seems to be able to write the make file but not execute it!
administrator@varunraj ~/.cpan/build/Data-Dumper-2.125-aK6NQv $ ls Changes Dumper.pm MANIFEST Makefile Todo pm_to_blib t Dumper.c Dumper.xs META.yml Makefile.PL blib ppport.h administrator@varunraj ~/.cpan/build/Data-Dumper-2.125-aK6NQv $ perl Makefile.pl Writing Makefile for Data::Dumper administrator@varunraj ~/.cpan/build/Data-Dumper-2.125-aK6NQv $ make Skip blib/lib/Data/Dumper.pm (unchanged) gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing + -pipe -fs tack-protector -I/usr/local/include -DUSEIMPORTLIB -O3 -DVERSION=\"2 +.125\" -DX S_VERSION=\"2.125\" "-I/usr/lib/perl5/5.10/i686-cygwin/CORE" -DUSE_P +PPORT_H Du mper.c cc1: error: unrecognized command line option "-fstack-protector" make: *** [Dumper.o] Error 1
i was able to install the Spreadsheet module without a problem...
Do let me know if u know why this is not working..
Oh and yea the data dumper folder is 389 KB

Replies are listed 'Best First'.
Re: Unable to install Data::Dumper module
by Corion (Patriarch) on Feb 16, 2010 at 09:52 UTC

    Data::Dumper is a part of Perl and should come installed with your Perl installation already. If your distributor did exclude it, you have to find what package they put it in instead. You can check whether you have Data::Dumper installed by running the following command:

    perl -MData::Dumper -e 'print "Data::Dumper is installed"'

    The error message indicates that your C compiler is a different C compiler (version) than what was used to compile Perl with - this likely means that you will encounter more problems when you try to install Perl modules with a C (or "XS") component.

      It says that it is installed but whenever i try using it in a perl script, this is what i get:
      administrator@varunraj ~/scripts $ perl ex1.pl Can't locate Data/Dupmer.pm in @INC (@INC contains: /usr/lib/perl5/5.1 +0/i686-cyg win /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin /usr +/lib/perl5 /site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/i686-cygwin /usr/lib/p +erl5/vendo r_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5 +.8 /usr/li b/perl5/vendor_perl/5.8 .) at ex1.pl line 5. BEGIN failed--compilation aborted at ex1.pl line 5.
      It says it can't locate Dumper.pm
      This is the code i wrote:
      #!/usr/bin/perl #use strict; #use warnings; use XML::Simple; use Data::Dupmer; my $simple = XML::Simple->new(); my $struct = $simple->XMLin("./xml/exer1.xml", forcearray => 1, keepro +ot => 1); print Dumper($struct);

        You're trying to use Data::Dupmer, but the module name is Data::Dumper.

Re: Unable to install Data::Dumper module
by syphilis (Archbishop) on Feb 16, 2010 at 10:07 UTC
    cc1: error: unrecognized command line option "-fstack-protector"

    I saw the same error reported on the cygwin mailing list (albeit, for a different module) - to which Reini Urban replied "You have for sure only gcc-3 but you need gcc-4".

    Cheers,
    Rob
Re: Unable to install Data::Dumper module
by CountZero (Bishop) on Feb 16, 2010 at 20:09 UTC
    Is there a reason you do not use cpan or cpanplus to install modules but rather do it manually?

    cpan or cpanplus take care of the missing dependencies.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James