libz.dylib与libz.1.2.3.dylib对比libz.1.2.5.dylib [英] libz.dylib versus libz.1.2.3.dylib versus libz.1.2.5.dylib

查看:480
本文介绍了libz.dylib与libz.1.2.3.dylib对比libz.1.2.5.dylib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在评论中问过这个问题,但这似乎是一个值得回答的问题。

I asked this in a comment but this seems like an issue that deserves its own question.

我有一个项目在三个不同的XCode和两个安装之间共享iOS SDK的不同安装。目前统一所涉及的开发人员不是一种选择。

I have a project that's shared between three different installations of XCode and two different installations of the iOS SDK. At the moment unifying the developers involved is not an option.

当我安装iOS 5 Beta和XCode 4.2时 libz.1.2.3.dylib 无处可寻。我发现链接 libz.1.2.5.dylib 处理了这个,但这与XCode和iOS SDK的其他活动安装不兼容。

When I installed the iOS 5 Beta and XCode 4.2 libz.1.2.3.dylib was nowhere to be found. I discovered that linking against libz.1.2.5.dylib handled this but this was not compatible with the other active installations of XCode and the iOS SDK.

我在网上对此进行了研究并发现了上述建议并且建议。前者对我不起作用,后者让我感到紧张。

I researched this online and discovered the above suggestion and this suggestion. The former doesn't work for me, and the latter makes me nervous.

那么 libz.dylib libz.1.2.3.dylib libz.1.2.5.dylib 我可以安全地链接到XCode和iOS SDK的所有安装中的第一个?

So what's the difference between libz.dylib, libz.1.2.3.dylib and libz.1.2.5.dylib and can I safely link to the first across all installations of XCode and the iOS SDK?

推荐答案

操作系统通常包含许多版本的动态库。这些由不同的程序使用,具体取决于它们在编译时编译的库,但是在编译时,您希望链接与您包含/导入到源代码中的已安装标头相对应的版本。

The OS often includes many versions of dynamic libraries. These are used by different programs depending on which library they were compiled against at their compile time, but when you compile you want to link against the version that correspond to the installed headers which you are including/importing into your source code.

libz.dylib 将是指向已安装标头使用的同一版本的链接。

The libz.dylib will be a link to the same version that your installed headers use.

假设您有2个版本 libXYZ.1.dylib libXYZ.2.dylib libXYZ.dylib libXYZ.2.dylib 和<$ c的链接$ c> libXYZ.1.dylib 是一个遗留的lib,在操作系统中也可用于在 libXYZ.2.dylib 之前编译和分发的应用程序被释放了。 libXYZ.1.dylib 已包含在SDK中,因为可能存在仍旧要与旧版本链接的旧框架。

Say you have 2 versions libXYZ.1.dylib and libXYZ.2.dylib, libXYZ.dylib is a link to libXYZ.2.dylib and libXYZ.1.dylib is a legacy lib that is also available in the OS for apps compiled and distributed before libXYZ.2.dylib was released. The libXYZ.1.dylib has been included in the SDK because there can be old frameworks that still want to be linked against the old version.

两个版本的标题中可能有非常相似的接口,因此在编译和运行时不会看到任何真正的差异,但在将来的版本中,旧版本可能会得到删除和添加新的,这将使您的项目在链接时中断。

The two versions might have very similar interfaces in the header so you won't see any real differences when you compile and run, but in future versions the older versions might get removed and new ones added which will make your project break when linking.

如果我理解正确,链接器将取消引用文件链接,以便找到正确的版本并保持该dylib名称并在应用程序启动时动态链接到该名称。所以 libz.dylib 将不是使用的路径(超过编译时)。

If I understand it right, the linker will dereference file links so it will find the right version and keep that dylib name and dynamically link against that when the app starts. So the libz.dylib won't be the path used (more than at compile time).

我明白了这是我在4.3 SDK中安装的Xcode

I see this in my Xcode installation in the 4.3 SDK

/* zlib.h -- interface of the 'zlib' general purpose compression library
  version 1.2.3, July 18th, 2005

  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler



libz.dylib



libz.dylib

/Developer/.../SDKs/iPhoneOS4.3.sdk/usr/lib/libz.dylib -> libz.1.2.3.dylib

这篇关于libz.dylib与libz.1.2.3.dylib对比libz.1.2.5.dylib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆