Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

GD::Image: Can't locate object method "newFromJpeg"
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.


Report this thread to moderator Post Follow-up to this message
Old Post
dirson@gmail.com
04-07-05 08:56 AM


Re: GD::Image: Can't locate object method "newFromJpeg"
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


Report this thread to moderator Post Follow-up to this message
Old Post
x3v0-usenet@yahoo.com
04-09-05 08:55 PM


Re: GD::Image: Can't locate object method "newFromJpeg"
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


Report this thread to moderator Post Follow-up to this message
Old Post
x3v0-usenet@yahoo.com
04-11-05 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Modules archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:01 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.