You can run
Code:
ldd /path/to/SDL-app |grep libpng
to see where your application finds libpng.
If for example it uses libpng-1.2.44 from /usr/lib and you want to use libpng-1.4.3 that resides in /usr/local/lib, you can use (for bash)
Code:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
before running your application.
Regards