xcode 7.1 for iOS 9 missing libc++.dylib required

2019-04-23 18:28发布

问题:

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?

回答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


回答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



回答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


回答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.