So this has happened a few times across different projects where my iOS app failed to compile. The first one was particularly sad because when building a static framework that I include in my work app, because of
libz. We were referencing
libz.1.2.3 which is apparently not included in iOS 5 SDK. I think it only contains version
1.2.5 now. The worst part was that
libtool was failing, and it gave absolutely no clue as to why. The error simply said,
libtool failed with error code 1
Bravo. After head-banging for a couple hours and trying random stuff, I removed libz and suddenly the project compiled.
In another project, XCode for more helpful and guided me to the error rightaway by uttering some useful errors,
ld: library not found for -lz.1.2.3
Lesson learnt. Now I’m just referencing
libz.dylib in the project as it is a symbolic link to the actual library and hopefully will always be there when needed.