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

hi, i'm a newbie to perl and i wanna use GD::Graph module. when running perl Makefile.PL, GD.xs has some errors in it eg. GD.xs:933: invalid lvalue in assignment. its got quite a number of these errors then finally it gives
make: ***[GD.o]Error1
so when compiling my program it gives me error:
Can't locate GD/Text/Align.pm @INC (@INC contains ...) at /usr/lib/perl5/site_perl/5.6.0/GD/Graph.pm line 39,
then it gives me the following errors:
Compilation failed in require errors at Graph.pm, axestype.pm and line +s.pm

Replies are listed 'Best First'.
Re: GD::Graph::lines compile errors
by theorbtwo (Prior) on Apr 12, 2003 at 20:13 UTC

    Interesting. GD.xs is not read during the perl Makefile.PL step of building. Did you follow the proper steps? What is GD.xs, line 933? What versions of perl, Gd (the C library), and GD (the perl module) are you using? What OS are you on (and, if Linux, what distribution)?


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      I've got

      perlv5.6.0,

      GD-2.06,

      GDGraph-1.39,

      GdTextUtil-0.85,

      Red Hat linuxi386version 2.4.7-10

Re: GD::Graph::lines compile errors
by zentara (Cardinal) on Apr 13, 2003 at 15:32 UTC
    Getting the GD modules to run properly requires you keep close track of the versions of all the components. That said, about the only general rule is get the very latest versions of everything, that means perl 5.8, the latest version of the c libs from www.boutell.com, and the latest cpan modules. The current ones work fine, for me. As for getting them to run on Perl5.6, your best bet is to use the c -libs available during the heyday of 5.6 and the corresponding GD module level from that time. When I upgraded from Perl 5.6 to 5.8, the GD modules were not working for me, but after getting the latest boutell c-libs and Cpan modules, it started to work. I'm sorry I don't have (handy) the version numbers that worked for me under 5.6. Maybe someone else who currently has it setup can tell you. You need a "compatible pair" of the GD-c-libs and perl modules. It's annoying, but gratifying when you find the right combination, and get all the GD features to work under Perl.

      Just to add another combination that come up with the same error:
      Perl v5.6.1 build 635 provided by ActiveState
      GD 2.06
      GDGraph 1.35
      Both modules were installed via ppm.
      This gives the error:

      Can't locate GD/Text/Align.pm in @INC (@INC contains: C:/Perl/lib C:/P +erl/site/l ib .) at C:/Perl/site/lib/GD/Graph.pm line 39.