dyld: Symbol not found: __cg_png_create_info_struct

git clone xxx 时出现的一个错误

dyld: Symbol not found: __cg_png_create_info_struct

解决方法:

brew uninstall libpng

可能会出现提示:

Error: Refusing to uninstall /usr/local/Cellar/libpng/1.6.26
because it is required by freetype, which is currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies libpng

按照提示:

brew uninstall --ignore-dependencies libpng

输出

Uninstalling /usr/local/Cellar/libpng/1.6.26... (26 files, 1.2MB)
libpng 1.6.21 is still installed.
Remove all versions with `brew uninstall --force libpng`.