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