I am trying to compile and run this code under ubuntu 14.04. I downloaded and installed libpng version 1.6.12. I am able to compile the code using gcc test.c -lpng
but when I try to run it, I get this error: ./a.out: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory
edit:
So I found libpng16.so.16, it was in /usr/local/lib
and I copied it to /usr/local/include/libpng16/
and as well to /usr/local/include/
and recompiled the code, anyway the problem still persists.
Any suggestions ?
Ok so I found the solution here. The trick is to run sudo ldconfig
after you install some shared library.
You can download the library from the link https://sourceforge.net/projects/libpng/?source=directory
It will download a file something like "libpng-1.6.32.tar.xz"
Simply extract the file go inside folder and run these commands to install
./configure make check make install
Then you need to run after installing any library
ldconfig
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With