开发者

Compile a C program with libpng on Mac OS X

开发者 https://www.devze.com 2023-02-14 12:34 出处:网络
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 b

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消