Compile a C program with libpng on Mac OS X

人走茶凉 提交于 2019-12-10 20:14:23

问题


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 specify an include path for png.h?


回答1:


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.



来源:https://stackoverflow.com/questions/5186307/compile-a-c-program-with-libpng-on-mac-os-x

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!