Perl Tutorials - Herong's Tutorial Examples - v6.01, by Dr. Herong Yang
Install Imager::File::PNG Manually
This section provides a tutorial example on how to install Imager::File::PNG Perl module manually from source code files on macOS. Installation failed with wrong architecture in LIBPNG library.
With the PNG library installed, we can try to install Imager::File::PNG manually.
1. Go to Imager::File::PNG Website at https://metacpan.org/pod/Imager::File::PNG.
2. Click "Download" to get the source code file, Imager-File-PNG-0.94.tar.gz.
3. Unzip and untar it to extract its source files in "Imager-File-PNG-0.94" folder.
4. Try the following commands to install it:
herong$ perl Makefile.PL --libpath=/Users/herong/lib/libpng/lib \ --incpath=/Users/herong/lib/libpng/include --verbose PNG: building independently PNG libpath: /Users/herong/lib/libpng/lib PNG libpath: /Users/herong/lib/libpng/lib PNG: Searching directories for libraries: PNG: /Users/herong/lib/libpng/lib PNG: Found! PNG incpath: /Users/herong/lib/libpng/include PNG: Searching directories for headers: PNG: /Users/herong/lib/libpng/include PNG: Found! PNG: Generic: includes found - libraries found Asking liblist for LD_RUN_PATH: Potential libraries are '-L/Users/herong/lib/libpng/lib -lpng': '-lpng' found at /Users/herong/lib/libpng/lib/libpng.dylib Setting LD_RUN_PATH=/Users/herong/lib/libpng/lib for PNG probe ... ld: warning: ignoring file /Users/herong/lib/libpng/lib/libpng.dylib, file was built for x86_64 which is not the architecture being linked (i386): /Users/herong/lib/libpng/lib/libpng.dylib Undefined symbols for architecture i386: "_png_access_version_number", referenced from: _main in assertlibunQkgKfm-f31b93.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 PNG: Test code failed: Can't link/include 'png' ...
Looks like there is a problem with the libpng.dylib we generated in the last tutorial.
Table of Contents
Data Types: Values and Variables
Expressions, Operations and Simple Statements
Name Spaces and Perl Module Files
Hard References - Addresses of Memory Objects
Objects (or References) and Classes (or Packages)
Typeglob and Importing Identifiers from Other Packages
String Built-in Functions and Performance
File Handles and Data Input/Output
Open Directories and Read File Names
File System Functions and Operations
Imager - Create and Save Image
Imager - Draw Graphical Elements
Imager - Convert Image File Format
Imager::File::PNG - PNG File Format
Install LIBPNG from Source Code
►Install Imager::File::PNG Manually
Install PerlMagick from Source Code
Socket Communication Over the Internet
XML::Simple Module - XML Parser and Generator
SOAP::Lite - SOAP Server-Client Communication Module
Perl Programs as IIS Server CGI Scripts
CGI (Common Gateway Interface)
XML-RPC - Remote Procedure Call with XML and HTTP
RPC::XML - Perl Implementation of XML-RPC
Integrating Perl with Apache Web Server
CGI.pm Module for Building Web Pages
LWP::UserAgent and Web Site Testing
Converting Perl Script to Executable Binary