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
Xcode cannot resolve zlib symbols
提问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.
在下拉列表中选择 libz.dylib。