I use the zlib library to do data compression in a command line tool for Mac.
On Xcode 4, I get an error "undefined symbol" on zlib functions.
I search for the 开发者_开发问答libz.dylib on mac computer and I find 3 files in /Developer/Platforms/iPhoneOS.platform
.
Nothing in /Developer/Platforms/MacOSX.platform
.
Why? Where I can find my libz.dylib library for architeture i386?
In Xcode 4 have a look at your Build Phases.
Go to the 3rd section - Link Binary with libraries
Click the +
button
choose libz.dylib in the drop down.
You can download zlib from its site, look further down in the page for the download links.
You can also happen to have installed macports or fink. In this case, you get there prebuilt versions.
精彩评论