The VERY first thing that I would do is run ldconfig
before you try to compile the program. ldconfig
will update the shared library links, so if anything new was installed, ldconfig
will make sure it's available to use.
second thing first, visually verify that libpng is installed in a library path that is commonly accessable (which are /lib, /usr/lib, and any of the shared library directories defined in /etc/ld.so.conf).
You can complete this by this bash one-liner:
# for i in /lib /usr/lib `cat /etc/ld.so.conf | tr '\n' ' '`; do echo "--searching dir $i"; find $i -name "*png*"; done
That will show you any place in the common library directories that the libpng exists. If ld.so.conf doesn't exist, then simply replace the `cat...` part with /usr/local/lib, as:
# for i in /lib /usr/lib /usr/local/lib; do echo "--searching dir $i"; find $i -name "*png*"; done
If it returns no libpng files, then your problem is that the libraries are either not installed, or installed in a funky place. You're going to have to find out where they are installed. One way to do this is:
find / -type f -name "libpng*"
But, I warn you, this search will take a while.
Assuming that we did find the libraries in the common directories, you need to verify that the proper files exist.
exist? If not, then you cannot build static binaries (binaries where the libpng info is built-in). You'll have to recompile libpng with the --enable-static command line option to configure, and reinstall.
exist? If not, then you cannot build shared binaries (where the libpng info is linked from the libpng.so file, making the binary smaller). You'll have to recompile libpng with the --enable-shared option passed to configure, and reinstall (the static and shared options can be passed to configure together).
If libpng.so exists, it should be a symlink to libong.so.2 (I'm running version 1.0.3, which is not the current version, so the library will be 22.214.171.124. newest version will be (I think) 126.96.36.199)
And libpng.so.2 should symlink to linpng.188.8.131.52.
If any of that doesn't make sense, or you don't get how to fix or verify that this stuff is set correctly, simply copy/paste the results of ls -o /path/to/libpng*
in a reply, and someone here will tell you.
If the libraries are installed, and all the above stuff is right, then the next step is to make sure that the compilation process is able to find the libraries.
What is the exact error message you're getting when trying to compile? What command line did you run?