ld: library not found for -lz.1.2.3

Zhen picture Zhen · Oct 19, 2011 · Viewed 15.8k times · Source

When trying to compile the software for iOS 5, XCode 4.2 throws an error:

ld: library not found for -lz.1.2.3

I found this post that tells me to replace 1.2.3. with 1.2.5

https://github.com/dbloete/ioctocat/issues/107

After doing what the link has suggested, it worked for XCode 4.2 but fails for older versions for XCode with the error

 ld: library not found for -lz.1.2.5

Has anyone encountered the above situation? How can I resolve this so that it will not fail between the different versions of SDK?

Answer

Alastair Stuart picture Alastair Stuart · Oct 19, 2011

Just use -lz, there's no need to use the versioned link to it. So remove libz-1.2.5.dylib from frameworks and add libz.dylib.