I thought Mac OS X comes with libpng pre-installed. It’s pretty clear that I was wrong after I failed to compile a game that uses libpng. The good thing about OS X is that, you can just use fink to easily install Unix/Linux binaries. However, the weird thing is, the game configuration still complains that libpng could not be found.
So I decided to install libpng from the source code. For those out there who may face the same problem, you could try as what I describe below.
- Download the library source code from libpng.org.
- Untar it:
$ tar -xjvf libpng-1.2.8.tar.bz2 - Go into the
libpng-1.2.8directory, and copy themakefile.darwinout$ cd libpng-1.2.8 && cp scripts/makefile.darwin makefile - Run make:
$ make(It’s gonna take a while) - Install the compiled library into appropriate place:
$ make install - Clean up the
messobject files:$ make clean
That’s it. The requirement, of which I should have mentioned earlier, to compile libpng is the zlib. I hope you have zlib installed first.