我们应该在 iOS 上使用哪个 libiconv?
当我在 Xcode 中执行“添加现有框架”时,我看到了三个版本的 libiconv。
- libiconv.dylib
- libiconv.2.dylib
- libiconv.2.4.0.dylib
这个链接显示了最新的最大的是 1.13.1。我认为这与上面的数字不一样。
有什么线索吗?
When I do "Add Existing Frameworks" in Xcode, I see three versions of libiconv.
- libiconv.dylib
- libiconv.2.dylib
- libiconv.2.4.0.dylib
This link says the latest and greatest is 1.13.1. I don't think it's the same as the numbers above.
Any clues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过检查
/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.1/Symbols/usr/lib/
文件夹,其中唯一一个实际的库是 libiconv.2.dylib。 libiconv.dylib 和 libiconv.2.4.0.dylib 都是 libiconv.2.dylib 的别名(即,如果您更喜欢用 UNIX 术语来思考,则为符号链接)。因此,目前,您链接到的可能性绝对为零。链接到最能接受一般性的链接。因此,如果您可以处理任何版本的 API,请链接到 libiconv.dylib,如果您需要与 libiconv 版本 2 一起使用的 API,则链接到 libiconv.2.dylib,如果您专门依赖 2.4.0 中的功能然后链接到 libiconv.2.4.0.dylib。我认为,根据 UNIX 中的工作方式,Apple 可能会根据兼容性要求更改 dylib 的别名,或者在将来实际提供多个版本的 dylib。目前一切都是学术性的。
据我从 Google 得知,libiconv-1.12 构建为 libiconv.2.4.0.dylib。我无法确定该版本编号背后的基本原理或这个想法的来源。
From checking the
/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.1/Symbols/usr/lib/
folder, the only one of those that's an actual library is libiconv.2.dylib. Both libiconv.dylib and libiconv.2.4.0.dylib are aliases (ie, symbolic links if you prefer to think in UNIX terms) for libiconv.2.dylib.So at the minute, it'll make absolutely no odds which you link to. Link to the one that gives you the most acceptable generality. So if you can handle any version of the API, link to libiconv.dylib, if you need the API that goes with version 2 of libiconv then link to libiconv.2.dylib and if you're relying on functionality in 2.4.0 specifically then link to libiconv.2.4.0.dylib. I assume that, as per the way things tend to work in UNIX, Apple may change what's an alias for what or actually supply multiple versions of the dylib in future as compatibility requires. At the moment it's all academic.
From what I can make out from Google, libiconv-1.12 builds to libiconv.2.4.0.dylib. I'm not able to determine the rationale behind that version numbering or where the idea comes from.