Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Building with -MCPAN but cannot find libraries

by mldvx4 (Pilgrim)
on Jul 30, 2022 at 19:13 UTC ( #11145860=perlquestion: print w/replies, xml ) Need Help??

mldvx4 has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying add Image::Scale manually using -MCPAN, but get an error in that the installation process cannot find the installed libraries:

# perl -MCPAN -e shell

Once in the shell, I try to install the module:

cpan[1]> install Image::Scale Reading '/root/.cpan/Metadata' Database was generated on Sat, 30 Jul 2022 16:29:03 GMT Running install for module 'Image::Scale' Checksum for /root/.cpan/sources/authors/id/A/AG/AGRUNDMA/Image-Scale- +0.14.tar.gz ok Scanning cache /root/.cpan/build for sizes ...................................................................... +......DONE 'YAML' not installed, will not store persistent state Configuring A/AG/AGRUNDMA/Image-Scale-0.14.tar.gz with Makefile.PL Image::Scale requires at least one of libjpeg or libpng, please instal +l one or both and try again. No 'Makefile' created AGRUNDMA/Image-Scale-0.14.tar.gz /usr/bin/perl Makefile.PL -- NOT OK Failed during this command: AGRUNDMA/Image-Scale-0.14.tar.gz : writemakefile NO -- No + 'Makefile' created

The system seems to have the libraries installed:

$ find / -type f \( -name 'libpng*' -o -name 'libjpeg*' \) -print /usr/lib/libpng16.so.16.37.0 /usr/lib/libjpeg.so.8.2.2 /usr/lib/libpng16.a

What steps have I missed or gotten wrong?

Replies are listed 'Best First'.
Re: Building with -MCPAN but cannot find libraries
by choroba (Archbishop) on Jul 30, 2022 at 20:28 UTC
    You also need to install the libraries' header files (e.g. /usr/include/libpng16/png.h or whatever your system uses). They are usually located in devel packages, i.e. libpng-devel-*.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Thanks! I appreciate it. I succeeded now after adding the development packages for libpng, etc. I also had to add perl-dev and musl-dev.

      % perl -MImage::Scale -e 'exit' % echo $? 0

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11145860]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2022-08-14 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?