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

4

9

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?

Polinski answered 2/10, 2015 at 18:59 Comment(2)
same problem for me, the application crashes on the first Realm-related command with EXC_BAD_ACCESSEndocrine
Same issue, but upgrading an older cocos2d-x project to a new version of cocos2d-x framework. I think your question applies.Kirkham
N
17

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
Nigel answered 25/5, 2016 at 3:26 Comment(0)
C
4

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

Cargo answered 9/10, 2015 at 7:12 Comment(0)
S
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
Subdominant answered 11/12, 2015 at 10:49 Comment(0)
T
1

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.

Treulich answered 6/10, 2015 at 20:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.