Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ld: library not found for -lz.1.2.3

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?

like image 259
Zhen Avatar asked Oct 19 '11 00:10

Zhen


People also ask

How to fix “/usr/bin/LD cannot find -LC” error?

The “/usr/bin/ld cannot find -lc” error is related to the C development library named libc-dev . So installing the libc-dev can resolve this error. The “/usr/bin/ld cannot find -lltdl” error is related to the C development library named ltdl-dev . So installing the libtdl-dev can resolve this error.

Why can't I find some libraries on my System?

So you are responsible for the problem that some libraries cannot be found. In case that these libraries are available on your system, they seem to be located in non-standard directory locations. Use -R directory for the final compiler call to tell the linker the directory where the libraries are located.

How to find the directory where the libraries are located?

In case that these libraries are available on your system, they seem to be located in non-standard directory locations. Use -R directory for the final compiler call to tell the linker the directory where the libraries are located. More than a single -R directory option is possible.

How to add LD_LIBRARY_PATH to the loader?

Show activity on this post. LD_LIBRARY_PATH is suitable for short tests, but since there is only one variable, it is awkward to use when you might have multiple applications with custom libraries. The usual way for Debian/Ubuntu is to add it to the loader's configuration, e.g., a file under


1 Answers

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.

like image 162
Alastair Stuart Avatar answered Sep 28 '22 09:09

Alastair Stuart