Hi! Thanks for your help. See below for my comments.
I forgot to note that I'm using Mandriva Cooker (about to become Mandriva 2007) with perl-5.8.8-6mdk and gcc-4.1.1-2mdk on a P4-2.4GHz machine. On Monday 24 July 2006 15:07, Sisyphus wrote: > ----- 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. Indeed, I believe I fixed them in the copy on the web. > 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. That's the case indeed. I started from what Module::Starter::XSimple gave me, (which so far only supports building module templates using M::B) and since I was able to build everything so far, that's what I used. But I do need to add it somehow. > Did 'PHPFilter.so' actually get built for you ? It was: <<<< shlomi:~/progs/perl/cpan/GD-PHPFilter-0.01$ ls -l ./blib/arch/auto/GD/PHPFilter/PHPFilter.so -rwxr-xr-x 1 shlomi shlomi 8962 Jul 24 15:49 ./blib/arch/auto/GD/PHPFilter/PHPFilter.so >>>> Like I said - I'm still a newbie at this, and it's the first time I'm trying to use Module::Build (which I only happily used for pure Perl modules so far) for PerlXS stuff. > 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. Hmmm... Maybe it's a function that the PHP guys coded in C. I'll have to check. > > 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 :-) OK. <<< shlomi:~/Docs/homepage/homepage/trunk$ perl -MModule::Build -le 'print $Module::Build::VERSION' 0.2801 >>> But maybe I should switch to ExtUtils::MakeMaker. Regards, Shlomi Fish --------------------------------------------------------------------- Shlomi Fish [EMAIL PROTECTED] Homepage: http://www.shlomifish.org/ Chuck Norris wrote a complete Perl 6 implementation in a day but then destroyed all evidence with his bare hands, so no one will know his secrets.