ld: library not found for -lz

前端 未结 2 865
无人共我
无人共我 2021-02-09 16:32

This is driving me crazy, when i try to compile on the simulator, everything is ok, but on the device i got this error:

ld: library not found for -lz
Command /De         


        
2条回答
  •  暖寄归人
    2021-02-09 17:26

    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.

提交回复
热议问题