paulslocum
Posts: 74
Joined: Sun Apr 09, 2017 10:54 pm

How to downgrade libpng16? Unable to run DIspmanx PNG programs on Stretch

Fri Apr 20, 2018 11:00 pm

On Raspbian Stetch I'm unable to run my Raspbian Jessie C++ programs using the Dispmanx PNG example because there's only libpng12-dev available but libpng16 installed, and they do not seem to work together. When I try to run a program built with libpng12-dev on libpng16 it gives a warning and then crashes. The program builds and works perfrectly on Raspbian Jessie.

I tried uninstalling libpng16-16 and making sure libpng12-0 was installed, then I rebuild my program which is linked with "-lpng12", but when I try to run it says

Code: Select all

error while loading shared libraries: libpng16.so.16
.
Why is it still looking for libpng16? How do I get PNG programs to build and run on Raspbian Stretch?

User avatar
topguy
Posts: 5618
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How to downgrade libpng16? Unable to run DIspmanx PNG programs on Stretch

Sat Apr 21, 2018 10:03 pm

In Stretch the package is just called "libpng-dev" and should give you 1.6 : https://packages.debian.org/stretch/libpng-dev
I see that Raspbian has included the binary for 1.2, probably for some backward compability for a specific program.

Code: Select all

[email protected]:~ $ apt-cache search libpng
libpng16-16 - PNG library - runtime (version 1.6)
libpng-tools - PNG library - tools (version 1.6)
libpng12-0 - PNG library - runtime
libpng-dev - PNG library - development (version 1.6)

paulslocum
Posts: 74
Joined: Sun Apr 09, 2017 10:54 pm

Re: How to downgrade libpng16? Unable to run DIspmanx PNG programs on Stretch

Sun Apr 22, 2018 2:58 pm

I ended up reverting back to Jessie, but I'll try again and report back when I make another attempt at switching to Stretch.

Return to “C/C++”