[英]Perl Imager - libpng PNG libraries or headers not found
I am trying to run Perl script in Terminal - the outcome should be image.png (picture of OID for "magical pen"), but I keep running error.我正在尝试在终端中运行 Perl 脚本 - 结果应该是 image.png (“魔术笔”的 OID 图片),但我一直在运行错误。 Not being programmer I used all my googling skills for more than a month with no success.
不是程序员,我使用了我所有的谷歌搜索技能一个多月没有成功。 I use MacBook - macOS Monterey.
我使用 MacBook - macOS 蒙特雷。
I am certain that this should work (tried the same steps on an older MacBook and the script ran just fine).我确信这应该可以工作(在旧 MacBook 上尝试了相同的步骤并且脚本运行得很好)。 During the installation on the other Mac there were no issues, on my Mac I had to do some changes for the Home-brew.
在另一台 Mac 上安装期间没有任何问题,在我的 Mac 上,我必须对 Home-brew 进行一些更改。 I am also not sure, if the Imager can use the libpng.
我也不确定 Imager 是否可以使用 libpng。 Well, don't ask me why, but I tried to install Imager::File::PNG and this is what I get:
好吧,不要问我为什么,但我尝试安装 Imager::File::PNG,这就是我得到的:
Running install for module 'Imager::File::PNG' Checksum for /Users/darina/.cpan/sources/authors/id/T/TO/TONYC/Imager-File-PNG-0.99.tar.gz ok Scanning cache /Users/darina/.cpan/build for sizes............................................................................DONE Configuring T/TO/TONYC/Imager-File-PNG-0.99.tar.gz with Makefile.PL PNG: building independently PNG: Generic: includes not found - libraries found PNG: v1.6: includes not found - libraries 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.6 (+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为 /Users/darina/.cpan/sources/authors/id/T/TO/TONYC/Imager-File-PNG-0.99.tar.gz 的模块 'Imager::File::PNG' 校验和运行安装 ok 扫描缓存 /用户/darina/.cpan/build 大小...................................................... .....................DONE 配置 T/TO/TONYC/Imager-File-PNG- 0.99.tar.gz 与 Makefile.PL PNG:独立构建 PNG:通用:未找到 - 找到库v1.4:未找到包含 - 未找到库 PNG:v1.2:未找到包含 - 未找到库 PNG:v1.0:未找到包含 - 未找到库 PNG:基础 (+libz):未找到包含 - 库未找到 PNG:v1.6 (+libz):未找到包含 - 未找到库 PNG:v1.5 (+libz):未找到包含 - 未找到库 PNG:v1.4 (+libz):未找到包含 -未找到库 PNG:v1.2 (+libz):未找到包括 - 未找到库 PNG: v1.0 (+libz): includes not found
PNG:v1.0 (+libz):包括未找到
Can anyone help me please, preferably with very detailed instructions like for a child?谁能帮助我,最好有非常详细的说明,比如孩子? Thank you Darina
谢谢达丽娜
The error message has "PNG libraries or headers not found".错误消息包含“未找到 PNG 库或标头”。 This means that you need to install extra stuff.
这意味着您需要安装额外的东西。 Package managers often have multiple packages for a library, such as the
libpng
and libpng-dev
. Package 管理器通常有多个用于库的包,例如
libpng
和libpng-dev
。 The latter one includes the header files and other things that another library would need to use libpng
.后者包括 header 文件和其他库需要使用
libpng
的其他内容。
SOLVED.解决了。 I finally made it work.
我终于让它工作了。 Possibly not the best solution since I am mostly copying and pasting other people solution (this was not Perl or Imager related).
可能不是最好的解决方案,因为我主要是复制和粘贴其他人的解决方案(这与 Perl 或 Imager 无关)。
I installed pkg-config (again via brew install pkg-config), than used pkg-config --cflags libpng, which actually found the directory of the package and then it finally let me install the Imager::File::PNG - saying PNG: Found via pkg-config libpng.我安装了 pkg-config(再次通过 brew install pkg-config),而不是使用 pkg-config --cflags libpng,它实际上找到了 package 的目录,然后它终于让我安装了 Imager::File::PNG - 说PNG:通过 pkg-config libpng 找到。
For people, who actually know, what just happened, feel free to leave a comment, I definitely won't be offended.对于真正知道刚刚发生的事情的人,请随时发表评论,我绝对不会被冒犯。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.