0

Ubuntu 22.04 here. In order to run older app, I installed libpng 1.2 using answer from Install libpng12 on ubuntu 22.04. No 50 points to comment there so I kindly ask here.

Why libpng-config --version says 1.2.59, from /usr/local/lib? It is //usr/local/bin/libpng-config -> libpng12-config . Should not higher version be used, original 1.6? How to restore 1.6 i.e. set this as main: /bin/libpng-config -> libpng16-config*.?

Building (compiling) other older app (that was made for libpng 1.2), I get error "png_create_read_struct failed" which seems related, as I see "libpng warning: Application built with libpng-1.2.59 but running with 1.6.37".

Is that libpng-config --version related? If 1.2 is really used to build, how is it running with 1.6, what does it really mean?

Note: there are many similar errors around, but I couldn't find the answer. Closest is Wrong library version used (libpng) but it is not real explanation.

Timur
  • 11
  • /bin/libpng-config is just a link. Normally it links to libpng16-config (a script with the version wired in), but maybe it links to libpng12-config. Both the 16 and 12 config files may exist, but there's only one link, so the latest install (1.2) grabbed it. – ubfan1 Oct 11 '23 at 21:19
  • @ubfan1 But /bin/libpng-config -> libpng16-config*. Really used is //usr/local/bin/libpng-config -> libpng12-config – Timur Oct 11 '23 at 21:33

1 Answers1

1

With the hint from the comment: libpng-config used is from PATH order. Once I uninstalled libpng 1.2, version was right and I could build. Since PPA of libpng 1.2 works now for Ubuntu 22.04, that is advised. And installation from referenced link should not be used.

Timur
  • 11