I have a little utility I wrote in C that uses libpng. Under linux, I just install libpng-dev and do "gcc myapp.c /usr/lib/libpng.so -o myapp". In Mac OS X, I have the Xcode tools installed, which I believe includes libpng. What do I link against, and do I need to s开发者_如何学Pythonpecify an include path for png.h?
Try /usr/X11/include/png.h - you'll find the libs in ../lib ( or /usr/X11/lib ) as well.
EDIT Mavericks doesn't appear to have this anymore. You may need to use homebrew or MacPorts to install libpng.
精彩评论