How to connect library to my project on ubuntu?

People help in a program using libpng, led the development on a single computer< transferred to another executable file and I got error

./prg error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory


How can I fix it and installed libpng from the repository handles not working :( Could be possible when compiling the ask as the thread that she was hanging out with prog? How to connect this library on the development machine, that the machine - the by ubuntu 16.04. Thank you!
June 10th 19 at 15:58
1 answer
June 10th 19 at 16:00
Solution
The right way: to build deb package and put it on.
Quick way: on the target machine, try to run sudo ldconfig.

To carry so-schnick with binary not worth it. If we are really tight, try to link statically.
sudo ldconfig - thank you so much) - maxwell_Monahan3 commented on June 10th 19 at 16:03

Find more questions by tags UbuntuC++