Search code examples
rstudiolinux-mintlibpng

libpng error "Incompatible libpng version in application and library" in Rstudio


I just set up Linux Mint 18.1 with Microsoft R Open 3.3.2 and downloaded Rstudio 1.0.136 over it. Everything works fine, except Rstudio appears to want to use a libpng version that 1) I don't have and 2) is not obvious to me it needs. Here's a sample code. It basically results in the error I get for anything else I try involving getting a graphic in Rstudio.

library(ggplot2)
qplot(carat, price, data=diamonds)
libpng warning: Application was compiled with png.h from libpng-1.6.23
libpng warning: Application  is  running with png.c from libpng-1.2.54
libpng error: Incompatible libpng version in application and library

It appears to be a problem unique to Rstudio. If I were to run that code in a GNOME terminal executing R, the graph renders just fine.

I do have libpng-1.2.54 installed on my computer. I installed the most current version of libpng16 in the package manager (1.6.20-2), but to no effect. Again, it's not clear to me why Rstudio is doing this, so any input about squaring this incompatibility error (ideally getting Rstudio to use libpng-1.2.54) would be appreciated.

Here's sessionInfo() if it's useful.

R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 18.1

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
[5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
[9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

Really any help would be appreciated.


Solution

  • Okay, found a simple fix. I don't know why Rstudio's .deb package referenced/required a libpng version that I don't have and wasn't necessary for installation. It's something the developers may want to explore, but adding --with-libpng to the command that starts the program (either in command line or in a launcher) will force Linux to find the system's version of libpng in lieu of one Rstudio thinks exists.

    example

    Apologies for cross-posting on Rstudio's support community.