简体   繁体   English

libpng未在Mac OSX 10.9.2上链接

[英]libpng not linked on Mac OSX 10.9.2

I installed matrix2png on my Mac and had used it without problem before last week when I installed another image manipulating tool "circos". 我在我的Mac上安装了matrix2png并在上周安装了另一个图像处理工具“circos”之前使用它没有问题。 Circos requires me to install a different version of libpng, and I did. Circos要求我安装不同版本的libpng,我做到了。 After that, I am no longer able to run matrix2png, which gives me the following error. 之后,我无法再运行matrix2png,这给了我以下错误。 I think the old ligpnb is not linked any more. 我认为旧的ligpnb不再联系了。 Does anyone know how to fix this error? 有谁知道如何解决这个错误? - appreciate your help. - 感谢您的帮助。

dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib
  Referenced from: /usr/local/bin/matrix2png
  Reason: image not found

Those step solve my problem: 那些步骤解决了我的问题:

brew versions libpng

You will see some versions of libpng, but unfortunately not 1.5.15, so next you should install 1.5.18. 你会看到一些版本的libpng,但遗憾的是不是1.5.15,所以接下来你应该安装1.5.18。

git checkout 7bec702 Library/Formula/libpng.rb
brew install libpng

You'll will find version 1.5.18 and some another versions. 你会发现1.5.18版和其他版本。

ln -s /usr/local/Cellar/libpng/1.5.18/lib/libpng15.15.dylib /usr/local/lib/libpng15.15.dylib`

See https://github.com/Homebrew/homebrew-php/issues/1055 请参阅https://github.com/Homebrew/homebrew-php/issues/1055

Some more info on installing certain versions of brew formulas can be found at https://coderwall.com/p/lqphzg . 有关安装某些版本的brew配方的更多信息,请访问https://coderwall.com/p/lqphzg

Your new version of libpng has probably changed the name of its dyld files. 您的新版libpng可能已更改其dyld文件的名称。 This often happens with upgrades (especially following a major release). 这通常在升级时发生(特别是在主要版本之后)。 To verify this, open up the terminal and type: 要验证这一点,请打开终端并键入:

ls /usr/local/lib/libpng*

What do you see? 你看到了什么?

From your error message we know that matrix2png is looking for libpng15 but if you've upgraded when instaling circos then you may now have libpng16 on your system. 从您的错误消息中我们知道matrix2png正在寻找libpng15但是如果您在安装circos时已升级,那么您现在可能在您的系统上安装了libpng16。 Consequently matrix2png won't be able to find the files that it's looking for and will be unhappy. 因此,matrix2png将无法找到它正在寻找的文件,并且会感到不快。

Fixing it this time: 这次修理它:

Try re-installing matrix2png and see whether it notices the dependency issues and fixes it for you. 尝试重新安装matrix2png并查看它是否注意到依赖性问题并为您修复它。 You don't really want to downgrade libpng nor do you want to have two versions of it on your system, so having an up-to-date version of matrix2png would be good. 你真的不想降级libpng,也不想在你的系统上有两个版本,所以拥有最新版本的matrix2png会很好。

It looks like matrix2png comes from C source code, so you'll want to rebuild it. 看起来matrix2png来自C源代码,因此您需要重建它。 Download the source code or and then open a terminal. 下载源代码或然后打开终端。 Navigate to the folder with the source code and run configure and then make . 导航到包含源代码的文件夹并运行configure然后make Configure will generate a Makefile for your system, and then make will use that file to generate a new binary. Configure将为您的系统生成一个Makefile,然后make将使用该文件生成一个新的二进制文件。 I've tested this on my Mac (with libpng16), and found that matrix2png built without any errors. 我在我的Mac上测试过这个(用libpng16),发现matrix2png没有任何错误。

Suggested future approach: 建议的未来方法:

To prevent future linking problems, you may want to use a package manager like homebrew or macports. 为了防止将来出现链接问题,您可能需要使用自制程序或macports之类的包管理器。 In case you're using (or want to use) homebrew , it has circos and lib2png ( but not matrix2png, sorry !). 如果你正在使用(或想要使用) 自制软件 ,它有circos和lib2png( 但不是matrix2png,对不起 !)。 Once brew is installed, type the following into the terminal: 安装brew后,在终端中键入以下内容:

brew install libpng

And it should detect linking issues / version conflicts and guide you through fixing them. 它应该检测链接问题/版本冲突并指导您修复它们。 Brew places all of it's files in a 'cellar' location in /usr/local/Cellar and then symbolically links them into your system. Brew将所有文件放在/ usr / local / Cellar中的“cellar”位置,然后将它们符号链接到您的系统中。

In case you're already using brew, try brew doctor and follow the instructions to resolve problems. 如果您已经在使用brew,请尝试使用brew brew doctor并按照说明解决问题。

My experience (I've been dealing with a lot of version conflicts in the past few weeks) is that package managers make life much easier. 我的经验(我过去几周一直在处理很多版本冲突)是包管理员让生活变得更轻松。 Occasionally I've had to remove and reinstall packages to fix version issues, but in general brew keeps things neat and working. 偶尔我不得不删除并重新安装软件包来修复版本问题,但一般来说,brew会保持整洁和有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM