I need to link libz in my project. Normally I would add libz.dylib under the Linked Frameworks and Libraries settings, but now there are only .tbd files and no .dylib files when you search the list of libraries to add. When building I get a "warning: skipping file '/Users/me/xcode7/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/lib/libz.tbd' (unexpected file type 'text' in Frameworks & Libraries build phase)"
Then I build fails with linker errors because of missing symbols. Am I missing something new in the way libraries are linked?
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.