Xcode 无法解析 zlib 符号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6126518/
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 21:06:56  来源:igfitidea点击:

Xcode cannot resolve zlib symbols

objective-cxcodelinkersymbols

提问by TheFrancisOne

I use the zlib library to do data compression in a command line tool for Mac.

我使用 zlib 库在 Mac 的命令行工具中进行数据压缩。

On Xcode 4, I get an error "undefined symbol" on zlib functions.

在 Xcode 4 上,我在 zlib 函数上收到错误“未定义符号”。

I search for the libz.dylib on mac computer and I find 3 files in /Developer/Platforms/iPhoneOS.platform.

我在 mac 计算机上搜索 libz.dylib 并在/Developer/Platforms/iPhoneOS.platform.

Nothing in /Developer/Platforms/MacOSX.platform.

什么都没有/Developer/Platforms/MacOSX.platform

Why? Where I can find my libz.dylib library for architeture i386?

为什么?在哪里可以找到适用于 i386 架构的 libz.dylib 库?

回答by Abizern

In Xcode 4 have a look at your Build Phases.

在 Xcode 4 中查看您的构建阶段。

Go to the 3rd section - Link Binary with libraries

转到第 3 部分 - 将二进制文件与库链接

Click the +button

点击+按钮

choose libz.dylib in the drop down. enter image description here

在下拉列表中选择 libz.dylib。 在此处输入图片说明

回答by sergio

You can download zlib from its site, look further down in the page for the download links.

您可以从其站点下载 zlib ,在页面中进一步向下查找下载链接。

You can also happen to have installed macportsor fink. In this case, you get there prebuilt versions.

您也可能碰巧安装了macportsfink。在这种情况下,您将获得预构建版本。