如何 link 到 xcode 7 beta 中的 libz 和 libsqlite?
How to link to libz and libsqlite in xcode 7 beta?
我遇到如下链接错误:
+[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:
但我已经将这些库添加到我的目标中。但目前所有这些库都有不同的扩展名 .tbd.
有什么想法吗?谢谢
XCode 7 在 link 处理待定文件时存在一个已知问题。这是 link 苹果开发者论坛关于如何 link 待定文件 XCode 7 - https://forums.developer.apple.com/message/8609#8609
的回答
[下面提供了 link 的片段]
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.
我有两个项目使用 zlib,一个找到 link,一个没有。我使用 "Linked Frameworks and Libraries" 中的“+”来设置它们。我终于想出了如何修复无法正常工作的问题:
- 将您在之前尝试中添加的所有 link 删除到 zlib
- 打开 Finder,转到
/usr/lib
,然后将 libz.dylib
别名拖到项目的 Frameworks 文件夹中
- 编译。这对我来说适用于 2015/08/23。
我遇到如下链接错误:
+[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:
但我已经将这些库添加到我的目标中。但目前所有这些库都有不同的扩展名 .tbd.
有什么想法吗?谢谢
XCode 7 在 link 处理待定文件时存在一个已知问题。这是 link 苹果开发者论坛关于如何 link 待定文件 XCode 7 - https://forums.developer.apple.com/message/8609#8609
的回答[下面提供了 link 的片段]
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.
我有两个项目使用 zlib,一个找到 link,一个没有。我使用 "Linked Frameworks and Libraries" 中的“+”来设置它们。我终于想出了如何修复无法正常工作的问题:
- 将您在之前尝试中添加的所有 link 删除到 zlib
- 打开 Finder,转到
/usr/lib
,然后将libz.dylib
别名拖到项目的 Frameworks 文件夹中 - 编译。这对我来说适用于 2015/08/23。