Hi,
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).
TIA
---
Greetz
Hendrik
.... Quidquid latine dictum sit, altum viditur.