Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4.2 link error: libz issue?

Tags:

xcode

ios

Moving a project to Xcode 4.2, I am getting a number of Mach-O linker unresolved errors, for things like _crc32, _expf, and _UnwindSjLj_Register, on a project that compiles and links fine in Xcode 4.0.3.

I suspect this might be a libz issue, since my previous project linked libz.1.2.3.dylib. I removed that reference, and added libz.1.2.5.dylib, that is found in my /Platforms/iPhoneOS.platform/DeviceSupport/5.0 (9A5259f)/Symbols 1/usr/lib folder.

I get the same 39 unresolved references whether I include libz.1.2.5.dylib or not, so it seems very suspicious.

like image 804
Andrew Smith Avatar asked Jul 21 '11 17:07

Andrew Smith


1 Answers

Link against the libz.dylib, but add it through the Build Phases tab.

Project >> Target >> Build Phases >> Link Binary With Libraries

Press + under the list and select the libz.dylib then it will add the lib so it will work inbetween SDK updates.

like image 166
epatel Avatar answered Sep 19 '22 05:09

epatel