.dylib file is missing

20,365

Solution 1

At last i fixed it. https://forums.developer.apple.com/thread/4572. Add the dylib files into "Other Linker Flags".

enter image description here

Solution 2

Here's what worked for me.

  1. Go into your Targets, Build Phases, "Link Binary with libraries", and click on the + button.

enter image description here

  1. Click on the "Add other..." button

enter image description here

  1. Hit CMD+Shift+G to open the "Go to folder" dialog, and cut'n'paste the folder: /usr/lib

enter image description here

  1. In the top-right search box, type in a section of your "missing" file, which for me, was libsqlite3.dylib, then click on Open.

enter image description here

This should link in the file which was previously missing.

(Tested with Xcode 7.1)

Solution 3

Remove it from "Link Binary with Libraries" fixed my error.

Solution 4

libz.dylib is now found under libz.tbd

the .tbd files are new "text-based stub libraries", that provide a much more compact version of the stub libraries for use in the SDK

see Swift 2 / iOS 9 - libz.dylib not found

Share:
20,365
Jio
Author by

Jio

Updated on October 26, 2020

Comments

  • Jio
    Jio over 3 years

    I am trying to compile my project in iOS 9. I am using XCode7. Here is how it looks like: error:

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/lib/libz.dylib (No such file or directory)
    error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/lib/libiconv.dylib (No such file or directory)
    

    My dylib files shows in red color so i tried to add it again but the is no dylib files, all the files are shown in .tbd instead of .dylib. Please help me on this..

  • Jio
    Jio almost 9 years
    error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeD‌​efault.xctoolchain/u‌​sr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneO‌​S.platform/Developer‌​/SDKs/iPhoneOS9.0.sd‌​k/usr/lib/libc++.tbd is not an object file (not allowed in a library)
  • Teja Nandamuri
    Teja Nandamuri almost 9 years
    are you trying to integrate any other SDK into your project ? Or is it just a plain code template ?
  • Jio
    Jio almost 9 years
    i am trying to integrate my own library to this project.. Both having .dylib libraries.
  • Jio
    Jio almost 9 years
    Hi fixed it... forums.developer.apple.com/thread/4572. Add the dylib files into "Other Linker Flags". Thanks Mr.T for the support
  • trojanfoe
    trojanfoe over 8 years
    I don't understand how this fixes the issue?
  • Jio
    Jio over 8 years
    Its not my personal findings.. its from apple developer forums
  • Shobhakar Tiwari
    Shobhakar Tiwari over 8 years
    @Jio for libxml2.dylib what exactly i need to add ??
  • Jio
    Jio over 8 years
    You need to add -lxml2
  • Rahul Iyer
    Rahul Iyer about 2 years
    Any idea how to add these flags via cmakelists ?