简体   繁体   English

libpng警告:使用libpng-1.2.26构建但使用1.5.2运行的应用程序

[英]libpng warning: Application built with libpng-1.2.26 but running with 1.5.2

I have a problem on my mac when trying in R to produce png images. 我在Mac上尝试在R中生成png图像时遇到问题。

I am getting this warnings: 我收到以下警告:

libpng warning: Application built with libpng-1.2.26 but running with 1.5.2

I am running the R 2.14 version using the R-studio GUI. 我正在使用R-studio GUI运行R 2.14版本。

I am not excatly sure about the libpng problem. 我不确定libpng问题。 When I am doing locate libpng-config I'm getting several hits, some with libong-config12, some with libpng-config14, some without nay numbers: 当我定位libpng-config时,我遇到了一些问题,有些是libong-config12,有些是libpng-config14,有些没有讨厌的数字:

ayeroslaviz:~ ayeroslaviz$ locate libpng-config
/Applications/XAMPP/xamppfiles/bin/libpng-config
/Library/Frameworks/GTK+.framework/Versions/2.18.X11/Resources/bin/libpng-config
/opt/local/bin/libpng-config
/usr/X11/bin/libpng-config
/usr/local/bin/libpng-config

When doing which libpng-config I'm getting: /usr/local/bin/libpng-config 当执行哪个libpng-config我会得到: /usr/local/bin/libpng-config

Is there a way to uninstall older versions of libpng or update the paths to the right version. 有没有办法卸载旧版本的libpng或将路径更新到正确的版本。 Unfortunately I am not even sure, what thesource of this warning, so I hope I gave here all the needed information. 不幸的是,我什至不确定该警告的来源,因此希望在此提供所有必要的信息。

I would be grateful for anyone who gives me a hint about how to solve this problem. 我将感谢任何给我提示有关如何解决此问题的提示。

thanks 谢谢

A. 一种。

Fortunately, you're using a Mac, so there's a simpler (but not documented) method. 幸运的是,您使用的是Mac,因此有一种更简单(但未记录)的方法。

quartz.save('my_filename.png', type='png') 

Note that the image you want to save must be the currently active quartz window. 请注意,要保存的图像必须是当前活动的石英窗口。

If your code still works, then don't worry about it. 如果您的代码仍然有效,则不必担心。 The fact this this is a warning rather than an error message means that there might be a problem, not that there definitely is a problem. 这是警告而不是错误消息,这意味着可能存在问题,而不是肯定存在问题。 IF you don't want to see the warning, wrap your R code in a call to suppressMessages . 如果您不想看到该警告,则将您的R代码包装在对suppressMessages的调用中。

suppressMessages(code_to_call_libpng)

This problem could occur because RStudio (or some other library you are using in your project) is using in-built libpng libraries (v1.2) and when the application run, the version installed in the system is v1.5: http://www.libpng.org/pub/png/pngfaq.html#mismatch . 发生此问题的原因是RStudio(或您在项目中使用的其他库)正在使用内置的libpng库(v1.2),并且在应用程序运行时,系统中安装的版本为v1.5: http:/ /www.libpng.org/pub/png/pngfaq.html#mismatch If this is the point, you could try to upgrade RStudio libpng libraries or downgrade system libpng ones. 如果是这样,您可以尝试升级RStudio libpng库或降级系统libpng库。

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

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