Hi,

thanks for the response, I checked with nm if gdImageCreate is listed (which it is)
When I compile it with gcc it works just fine.
I used : gcc -o gdexample gdexample.c -lgd    to compile it

I have a thread on PM with some details : http://perlmonks.org/index.pl?node_id=169364

> From the error it looks like it compiled OK, but at runtime it can't
> resolve the symbol gdImageCreate.  I don't know anything about gd, but
> you need to be sure that the library that your linking ( with -lgd ), is
> the right one/the right version etc.
> > I'm having problems using gd in Inline::C...
> > This works
> > 
> > #include <stdio.h>
> > #include "gd.h"
> > 
> > int main(void)
> > { gdImagePtr im;
> >   FILE *out;
> >   im = gdImageCreate(100,100);
> >   out = fopen("foo.jpg", "wb");
> >   gdImageJpeg(im, out,-1);
> >   fclose(out);
> >   gdImageDestroy(im);
> >   return 1;
> > }
> > 
> > but this does not :(
> > 
> > #!/usr/bin/perl
> > 
> > use Inline Config => FORCE_BUILD => 1,
> >                      CLEAN_AFTER_BUILD => 0;
> > 
> > use Inline C => Config => LIBS => '-L/usr/lib -lgd';
> > #I tried variations of the above line
> > use Inline C => Config => AUTO_INCLUDE  => '#include "gd.h"';
> > #Apparently can't use #include "gd.h" in the code itself
> > #Some say I can but it generates a bootstrap error here...
> > 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;
> > }
> > 
> > 
> > It is returning the following error
> > perl: relocation error: 
>/path/_Inline/lib/auto/gdexample_pl_2120/gdexample_pl_2120.so: undefined symbol: 
>gdImageCreate
> > 
> > I played with the Config params, checked gcc version, checked to see if libjpeg 
>was installed or if libgd was installed...
> > It appears -lgd doesnt end up in the Makefile.pl and Makefile. 
> > I tested simple Inline::C tests and they work on my system.
> > 
> > Is there a known cure for this? :)
> > 
> > BTW I'm using Perl 5.6.1, Inline 0.43, RH7.2, gcc is gcc version 2.96 20000731 
>(Red Hat Linux 7.1 2.96-98).

---
Greetz 

Hendrik 

.... Quidquid latine dictum sit, altum viditur. 

Reply via email to