Home > Archive > PERL Modules > April 2005 > GD::Image: Can't locate object method "newFromJpeg"
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
GD::Image: Can't locate object method "newFromJpeg"
|
|
| dirson@gmail.com 2005-04-07, 3:56 am |
| Hi.
I'm trying to execute this script
-----------------------------------
use GD;
my $srcimage = GD::Image->newFromJpeg("image_news.jpg");
my ($srcW,$srcH) = $srcimage->getBounds();
----------------------------------
But I get this error message:
Can't locate object method "newFromJpeg" via package "GD::Image" at
/home/user/script.pl line 2.
I've got 'jpeg-6b' installed at '/usr/local/jpeg-6b'. I tried to
install
GD Perl Module by using:
perl Makefile.PL -options "GD_JPEG" -lib_jpeg_path /usr/local/jpeg-6b
but I get this error message when 'make test'
-----------------------------
t/GD..........Can't load './blib/arch/auto/GD/GD.so' for module GD:
../blib/arch/auto/GD/GD.so: undefined symbol: gdImageCreateFromJpegCtx
at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
t/Polyline....Can't load
'/home/user/src/GD-2.23/blib/arch/auto/GD/GD.so' for module GD:
/home/user/src/GD-2.23/blib/arch/auto/GD/GD.so: undefined symbol:
gdImageCreateFromJpegCtx at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
at GD/Polyline.pm line 45
------------------------------
So I installed GD by using no options, and therefore I got the
described errors.
What am I doing wrong? Thank you very much.
| |
| x3v0-usenet@yahoo.com 2005-04-09, 3:55 pm |
|
dirson@gmail.com wrote:
> Hi.
>
> I'm trying to execute this script
>
> -----------------------------------
> use GD;
> my $srcimage = GD::Image->newFromJpeg("image_news.jpg");
> my ($srcW,$srcH) = $srcimage->getBounds();
> ----------------------------------
>
> But I get this error message:
> Can't locate object method "newFromJpeg" via package "GD::Image" at
> /home/user/script.pl line 2.
>
> I've got 'jpeg-6b' installed at '/usr/local/jpeg-6b'. I tried to
> install
> GD Perl Module by using:
> perl Makefile.PL -options "GD_JPEG" -lib_jpeg_path /usr/local/jpeg-6b
> but I get this error message when 'make test'
>
> -----------------------------
> t/GD..........Can't load './blib/arch/auto/GD/GD.so' for module GD:
> ./blib/arch/auto/GD/GD.so: undefined symbol: gdImageCreateFromJpegCtx
> at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line
230.
> t/Polyline....Can't load
> '/home/user/src/GD-2.23/blib/arch/auto/GD/GD.so' for module GD:
> /home/user/src/GD-2.23/blib/arch/auto/GD/GD.so: undefined symbol:
> gdImageCreateFromJpegCtx at
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
> at GD/Polyline.pm line 45
> ------------------------------
>
> So I installed GD by using no options, and therefore I got the
> described errors.
>
> What am I doing wrong? Thank you very much.
I remember having a similar problem installing GD. GD is very picky
about where it looks for lib files. Below is a complete log I made for
installing GD. Following this, I never have problems. Hopefully it will
help you.
****************************************
*********
add the lib path (Red Hat/Fedora specific I think)
----------------
add /usr/local/lib to /etc/ld.so.conf
run ldconfig -v
install libpng
--------------
cp over scripts/makefile.linux to ../makefile
make && make install
install jpeg libs
-----------------
../configure --enable-shared
make && make install
install freetype2
-----------------
../configure
make && make install
install gd
----------
../configure --enable-shared
make && make install
install GD.pm
-------------
LD_LIBRARY_PATH="/usr/local/lib"
export LD_LIBRARY_PATH
perl Makefile.PL
make && make test && make install
- Ken
| |
| x3v0-usenet@yahoo.com 2005-04-11, 3:56 pm |
|
dirson@gmail.com wrote:
> Hi.
>
> I'm trying to execute this script
>
> -----------------------------------
> use GD;
> my $srcimage = GD::Image->newFromJpeg("image_news.jpg");
> my ($srcW,$srcH) = $srcimage->getBounds();
> ----------------------------------
>
> But I get this error message:
> Can't locate object method "newFromJpeg" via package "GD::Image" at
> /home/user/script.pl line 2.
>
> I've got 'jpeg-6b' installed at '/usr/local/jpeg-6b'. I tried to
> install
> GD Perl Module by using:
> perl Makefile.PL -options "GD_JPEG" -lib_jpeg_path /usr/local/jpeg-6b
> but I get this error message when 'make test'
>
> -----------------------------
> t/GD..........Can't load './blib/arch/auto/GD/GD.so' for module GD:
> ./blib/arch/auto/GD/GD.so: undefined symbol: gdImageCreateFromJpegCtx
> at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line
230.
> t/Polyline....Can't load
> '/home/user/src/GD-2.23/blib/arch/auto/GD/GD.so' for module GD:
> /home/user/src/GD-2.23/blib/arch/auto/GD/GD.so: undefined symbol:
> gdImageCreateFromJpegCtx at
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
> at GD/Polyline.pm line 45
> ------------------------------
>
> So I installed GD by using no options, and therefore I got the
> described errors.
>
> What am I doing wrong? Thank you very much.
I remember having a similar problem installing GD. GD is very picky
about where it looks for lib files. Below is a complete log I made for
installing GD. Following this, I never have problems. Hopefully it will
help you.
****************************************
*********
add the lib path (Red Hat/Fedora specific I think)
----------------
add /usr/local/lib to /etc/ld.so.conf
run ldconfig -v
install libpng
--------------
cp over scripts/makefile.linux to ../makefile
make && make install
install jpeg libs
-----------------
../configure --enable-shared
make && make install
install freetype2
-----------------
../configure
make && make install
install gd
----------
../configure --enable-shared
make && make install
install GD.pm
-------------
LD_LIBRARY_PATH="/usr/local/lib"
export LD_LIBRARY_PATH
perl Makefile.PL
make && make test && make install
- Ken
|
|
|
|
|