xcode 无法在我的项目中添加 libpng 库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3449420/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 19:37:43  来源:igfitidea点击:

Unable to add libpng library in my project

iphonexcodepngstatic-librarieslibpng

提问by nomann

I am new to iPhone development and trying to load PNGs using libpng but unable to add it to my project after trying so much. I've got following errors while adding libpng to my project. Please help me how to get rid of these errors:

我是 iPhone 开发的新手,并尝试使用 libpng 加载 PNG,但在尝试了这么多之后无法将其添加到我的项目中。将 libpng 添加到我的项目时出现以下错误。请帮助我如何摆脱这些错误:

  • "_deflateReset", reference from...

  • "_inflateEnd", referenced from...

  • "_*inflate", referenced from...

  • "_deflate", referenced from...

  • "inflateInit", referenced from...

  • "_crc32", referenced from...

  • "deflateInit2", referenced from...

  • "_inflateReset", referenced from...

  • "_deflateEnd", referenced from...

  • “_deflateReset”,参考自...

  • “_inflateEnd”,引用自...

  • “_*inflate”,引用自...

  • “_deflate”,引用自...

  • inflateInit”,引用自...

  • “_crc32”,引用自...

  • deflateInit2”,引用自...

  • “_inflateReset”,引用自...

  • “_deflateEnd”,引用自...

回答by JWWalker

Those errors are link errors, not compile errors, right? I think those are symbols from zlib, not libpng.

那些错误是链接错误,而不是编译错误,对吗?我认为这些是来自 zlib 的符号,而不是 libpng。

EDIT TO ADD: try adding libz.dylib to the project.

编辑添加:尝试将 libz.dylib 添加到项目中。