2

I got linkage error like:

   +[WeChatApiUtil DecodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
  "_deflate", referenced from:
      +[MTAWXOHelper GZip:Out:] in libWeChatSDK.a(MTAWXOHelper.o)
  "_deflateEnd", referenced from:
      +[MTAWXOHelper GZip:Out:] in libWeChatSDK.a(MTAWXOHelper.o)
  "_deflateInit2_", referenced from:

But I've already added those library to my target. But currently all those library have different extension .tbd.

Any idea? Thanks.

Bagusflyer
  • 12,675
  • 21
  • 96
  • 179
  • The answer is in this other [link][1]. [1]: http://stackoverflow.com/questions/30815806/swift-2-ios-9-libz-dylib-not-found%20%22here%22. – Doug Jun 17 '15 at 13:46

2 Answers2

10

There is a known issue in XCode 7 while linking tbd files. Here is the link to the apple developer forum answer on how to link tbd files in XCode 7 - https://forums.developer.apple.com/message/8609#8609

[Snippet from the link is available below]

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

ViRa
  • 714
  • 5
  • 7
  • 10
    "... and help to significantly reduce its download size, at the expense of it not actually working" :) – trojanfoe Jul 15 '15 at 09:55
4

I have two project using zlib, one which finds it to link, one which doesn't. I set them both up by using the "+" in "Linked Frameworks and Libraries". I finally figured out how to fix the non-working one:

  1. Remove all links to zlib that you added in previous attempts
  2. Open Finder, head to /usr/lib, and drag the libz.dylib alias into your project's Frameworks folder
  3. Compile. This worked on 2015/08/23 for me.
Dov
  • 15,530
  • 13
  • 76
  • 177
user13428
  • 86
  • 2