Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Failure trying to build Imager::File::PNG

by GrandFather (Cardinal)
on Nov 14, 2012 at 04:20 UTC ( #1003743=perlquestion: print w/ replies, xml ) Need Help??
GrandFather has asked for the wisdom of the Perl Monks concerning the following question:

So I wanted to munge an image file to make it clear a site was an internal test site and not the main customer facing site. Imager looked to be just the ticket, and indeed it is very nice to use except that on Windows (where I was testing the script) I could only work with a .bmp version of the image - not the .png image I really wanted to work with. Never mind I thought, on the Linux machine where the script will finally run I'll be able to install Imager::File::PNG and all will be well.

Well, it's not! I get the same failure I did when I used cpan to try to install Imager::File::PNG on Windows. The Linux box is running 64 bit Debian Squeeze. Imager installed fine using apt-get on Debian and ppm on Windows. The relevant (I hope) part of the cpan output is:

Appending installation info to /usr/local/lib/perl/5.10.1/perllocal.po +d TONYC/Imager-0.93.tar.gz /usr/bin/make install -- OK Running make for T/TO/TONYC/Imager-File-PNG-0.86.tar.gz CPAN.pm: Going to build T/TO/TONYC/Imager-File-PNG-0.86.tar.gz PNG: building independently PNG: Not found via pkg-config PNG: Generic: includes not found - libraries not found PNG: v1.5: includes not found - libraries not found PNG: v1.4: includes not found - libraries not found PNG: v1.2: includes not found - libraries not found PNG: v1.0: includes not found - libraries not found PNG: base (+libz): includes not found - libraries not found PNG: v1.5 (+libz): includes not found - libraries not found PNG: v1.4 (+libz): includes not found - libraries not found PNG: v1.2 (+libz): includes not found - libraries not found PNG: v1.0 (+libz): includes not found - libraries not found PNG: Checking if the compiler can find them on its own Note (probably harmless): No library found for -lpng PNG: Test code failed: Can't link/include 'png.h', 'stdio.h', 'png' OS unsupported: PNG libraries or headers not found

Looks like there is a missing PNG library, but I can't tell what it is. Can anyone offer some help?

True laziness is hard work

Comment on Failure trying to build Imager::File::PNG
Download Code
Re: Failure trying to build Imager::File::PNG
by Anonymous Monk on Nov 14, 2012 at 04:25 UTC

    Looks like there is a missing PNG library, but I can't tell what it is. Can anyone offer some help?

    I'm sure one of README/INSTALL/pod explains what "PNG library" is or where to get "libpng"

Re: Failure trying to build Imager::File::PNG
by Tanktalus (Canon) on Nov 14, 2012 at 04:43 UTC

    "-lpng" always means "libpng.%ext" on unix/linux where %ext depends on the platform. However, on Linux, as far as I can tell, that's always .so, so look for a package that provides /usr/lib/libpng.so or /lib/libpng.so. On Gentoo, that's the libpng ebuild with a URL of http://www.libpng.org. Hope that helps.

    Also your test code failed with an inability to include "png.h" so there's another file to look for from your libpng package - /usr/include/png.h.

    Good luck - it built fine here :-)

      Thanks! That was the hint I needed.

      apt-get install libpng12-dev

      did the magic for me. Mind you, it took three tries before I found the right package!

      True laziness is hard work

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1003743]
Approved by 2teez
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2014-08-02 05:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (54 votes), past polls