Since I can't edit the root node, here are some updates...
Someone on inline@perl.org pointed me to some settings (which I also tried ofcourse). They seem correct and the makefile and out.make reflect it (something I failed to check before). I currently have errors on bootstrapping...
Had problems bootstrapping Inline module 'gdexample2_pl_9960' Can't load '/path/_Inline/lib/auto/gdexample2_pl_9960/gdexample2_pl_99 +60.so' for module gdexample2_pl_9960: /path/_Inline/lib/auto/gdexampl +e2_pl_9960/gdexample2_pl_9960.so: undefined symbol: jpeg_destroy at / +usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206. DynaLoader::croak('Can\'t load \'/path/_Inline/lib/auto/gdex...') +called at /usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206 DynaLoader::bootstrap('gdexample2_pl_9960') called at (eval 26) li +ne 9 eval ' package main; push @main::ISA, qw(gdexample2_pl_9960) unless $module eq "main"; local $gdexample2_pl_9960::VERSION = \'0.00\'; package gdexample2_pl_9960; push @gdexample2_pl_9960::ISA, qw(Exporter DynaLoader); sub dl_load_flags { 0x00 } gdexample2_pl_9960::->bootstrap; ;' called at /usr/lib/perl5/site_perl/5.6.1/Inline.pm line 432 Inline::load('Inline::C=HASH(0x8107f58)') called at /usr/lib/perl5 +/site_perl/5.6.1/Inline.pm line 267 Inline::glue('Inline::C=HASH(0 +x8107f58)') called at /usr/lib/perl5/site_perl/5.6.1/Inline.pm line 1 +94 Inline::init called at (eval 1) line 5 Inline::INIT() called at (eval 26) line 0 eval {...} called at (eval 26) line 0 at gdexample2.pl line 0 INIT failed--call queue aborted.
The tweak is only in the Config line..
> use Inline 'NOCLEAN'; use Inline 'C' => 'Config' => AUTO_INCLUDE => '#include "gd.h"', 'INC' => '-I/usr/include ', 'LIBS' => '-L/usr/lib -lgd ', ;
I have no idea what this all means altho I guess it has to do with loading up the XS linked code into the perl module :)

I DID IT!
I tried all sorts of things and eventually considered adding libjpeg to the lib list (altho plain C source didnt need it for compiling). This is a complete listing:
#!/usr/bin/perl use Inline Config => FORCE_BUILD => 1, CLEAN_AFTER_BUILD => 0; use Inline C => Config => LIBS => '-L/usr/lib -lgd -ljpeg', INC => '-I/usr/include', AUTO_INCLUDE => '#include "gd.h"'; use Inline C => 'DATA'; outtext(); __END__ __C__ int outtext() { gdImagePtr im; FILE *out; im = gdImageCreate(100,100); out = fopen("foo.jpg", "wb"); gdImageJpeg(im, out,-1); fclose(out); gdImageDestroy(im); return 1; }
Now I assume I'll need to include libpng too when I want to do PNG based stuff :)

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

In reply to Re: Inline::C and gd by Beatnik
in thread Inline::C and gd by Beatnik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.