xcode 7.1 for iOS 9 missing libc++.dylib required for Objective C Realm Static Framework

14,466

Solution 1

I had the same problem. I found some kind of way around.

  1. Go to Build Phases > Link Binary with Librairies > + > Add other
  2. Once in the file selection window do "CMD"+Shift+G (Go to folder) and type /usr/lib/
  3. From /usr/lib you can add : libc++.dylib and more... Compile and have fun

Solution 2

This is a known issue in the Xcode 7 beta.

To work around this issue for now, please: Delete all references to .tbd files from either your linked libraries phase, or from the copied bundle resources phase (where they sometimes will be added). Add the library you want to link manually to the "Other Linker Flags" build settings, by adding the argument: -l<library_name> for each library you want to link (for example, add "-lsqlite3" (without quotes)).

For those who are curious, 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, and help to significantly reduce its download size.

-- copy from link

finally, you can add -lc++ in this Other link Flags setting

Solution 3

I have same problem. I cannot find libc++.dylib through xcode but I found it using terminal.

You can copy or create a link to visible folder in xcode like /Users//Downloads.

Command below maybe help to fix the problem.

ln -s /usr/lib/libc++.dylib /Users/<your user>/Downloads/libc++.dylib

Solution 4

I had a similar issue with Realm the other week after the iOS 9 update. I know you already tried the method of going to build phases, add other, CMD + shift + G without success. However this was the method I used to locate libc++.dylib and I just checked it out again now and was able find it.

It is also worth mentioning that after you do manage to add libc++.dylib you may have build errors. In which case the fix I used was to go into your target's build settings and change Enable Bitcode to No.

Share:
14,466
sudoExclaimationExclaimation
Author by

sudoExclaimationExclaimation

Updated on July 22, 2022

Comments

  • sudoExclaimationExclaimation
    sudoExclaimationExclaimation almost 2 years

    I am following this doc for integrating realm in my iOS app.

    Realm static framework for iOS

    My problem is in step 3. I am unable to find libc++.dylib. I find a few other .tbd ones but none of them are libc++.

    I followed a few other SO posts on using the "add other" option and doing command+shift+G and find that library but it's not in that list either.

    Does anyone know any workarounds?

    • Peter Ivanics
      Peter Ivanics over 8 years
      same problem for me, the application crashes on the first Realm-related command with EXC_BAD_ACCESS
    • Hunter-Orionnoir
      Hunter-Orionnoir almost 7 years
      Same issue, but upgrading an older cocos2d-x project to a new version of cocos2d-x framework. I think your question applies.