ld: library not found for -lz

青春壹個敷衍的年華 提交于 2019-12-03 07:50:28
Petesh

You did specify the library libz.dylib in the Linked frameworks and Libraries item rather than the direct reference to libz.1.1.3 - in general you should use the most generic version of a library for compilation rather than a more specific one

Secondly, make sure that the libz.dylib is present under the iOS SDK - if it's missing, then it may be a mis-installed SDK (reinstall should fix that).

i.e.

find /Developer/Platforms -name libz.dylib

should result in a non-empty output for a libz.dylib under iPhoneOS5.0.sdk

Also see the answer to iPhone - Linker Error in Xcode 4.2 Preview, which is a similar issue to this.

i got the same error with a different library:

ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)

to resolve this, under search paths -> user header search paths -> release i put:

"$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts/include"

keep in mind that I get this bug only when I archive, and my archive is a based off my release scheme..


update: I got the same problem (on a different occasion/project) for the lpods Library (ie cocoapods).. the way i figured out to solve this is by realizing that the build worked fine on my development scheme but not my debug scheme. basically the development scheme had no for build active architectures only whereas debug had yes. I simply changed debug to no in all the targets under cocoapods

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!