----- Original Message ----- From: "Shlomi Fish" <[EMAIL PROTECTED]> To: <perl-xs@perl.org> Sent: Monday, July 24, 2006 9:02 PM Subject: Problems with the "new" constructor in a GD-derived module
> Hi all! > > This is my first message to this list. To cut to the chase, I'm trying to > write a derived class from the "GD" distribution in CPAN ( > http://search.cpan.org/dist/GD/ ). The code I have now is here: > > http://eskimo.shlomifish.org/Files/files/code/perl/gd-phpfilter/ > > (Note that I wrote it for work, so it may be considered an in-house code of > sorts, and not really open-source yet. But it's perfectly OK to look at it.) > > Now my problem is that I'm getting the following on "./Build test": > > <<< > t/01-object.......ok 1/10Can't locate auto/GD/new.al in @INC (@INC > contains: /home/shlomi/progs/perl/cpan/GD-PHPFilter-0.01/blib/lib > /home/shlomi/progs/perl/cpan/GD-PHPFilter-0.01/blib/arch > /home/shlomi/apps/perl/modules/lib/perl5/site_perl/5.8.8/i386-linux > /home/shlomi/apps/perl/modules/lib/perl5/site_perl/5.8.8/i386-linux > /home/shlomi/apps/perl/modules/lib/perl5/site_perl/5.8.8 > >>> > > I inherit from "GD" and also have my own new() function (which I think is > unnecessary), so I don't know what I'm doing wrong. > I don't use Module::Build (though I have it), so I wrote a Makefile.PL, relocated lib/PHPFilter.xs and typemap to the top level, and tried to build the ol' fashioned way. First problem was that I needed to remove your "TODO ..." comments from the XS file. I thought the same would be necessary if you were using Module::Build. And then I couldn't see any reference to the GD header or library in Build.pl, though I expected that would need to be specified, too. Did 'PHPFilter.so' actually get built for you ? It didn't for me, though I think I gave it every chance of succeeding. Sticking point for me was that `gdImageGrayScale' could not be resolved - so the build process failed at the 'make' stage. Where is that symbol defined ? it's not in my version (2.0.33) of GD. When I tried to build using your source "straight out of the box" with Module::Build, the shared object did not get built for the very same reason. It strikes me as a bug in Module::Build that the 'test' phase could then be run .... but, like I said, I don't use Module::Build ... and I know little about it (or its quirks and limitations :-) Cheers, Rob