xcode .dll 等效于 Mac OS X
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20586815/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
.dll Equivalent on Mac OS X
提问by weirdpanda
I am from a Windowsbackground and I am used to creating SDKs by creating (.dll)s and then distributing all the libraries and Documentation.
我来自Windows背景,我习惯于通过创建 ( .dll)s 然后分发所有库和文档来创建 SDK 。
So, if a user wants to use it, he adds a reference to the library and uses it. However, in a Mac, I am working on a SDK and I want a way of creatingand distributingMac libraries.
因此,如果用户想要使用它,他会添加对库的引用并使用它。但是,在 Mac 中,我正在开发一个 SDK,我想要一种创建和分发Mac 库的方法。
(I want to create the library in Objective-C) Please help me :)
(我想在Objective-C 中创建库)请帮助我:)
采纳答案by indragie
If you're creating a Mac library, you have either the option of creating a dylib, which includes only the compiled binary for the library, or creating a framework, which includes the compiled binary as well as headers and other bundle resources used by the library, in a single package. Frameworks are the preferred method of library distribution for the Mac.
如果您正在创建 Mac 库,您可以选择创建一个dylib,它只包含库的已编译二进制文件,或者创建一个框架,其中包括已编译的二进制文件以及头文件和其他包资源。库,在一个包中。框架是 Mac 库分发的首选方法。
If you're creating an iOS library, iOS doesn't support dynamic libraries of any kind (no dylibs or frameworks) so you're stuck with creating static librariesto distribute your code.
如果您正在创建一个 iOS 库,iOS 不支持任何类型的动态库(没有 dylib 或框架),因此您不得不创建静态库来分发您的代码。
回答by Holly
Both Mac and iOS have Dynamicly Linked Libraries. They just are not called that. They are generally just referred to as Shared Libraries and they typically are wrapped in Frameworks.
Mac 和 iOS 都有动态链接库。他们只是不那么叫。它们通常仅被称为共享库,它们通常包含在框架中。
Unfortunately, iOS limits the use of Shared Libraries to System Libraries and does not allow installing shared libraries on non-jailbroken devices.
不幸的是,iOS 将共享库的使用限制为系统库,并且不允许在非越狱设备上安装共享库。
Both platforms also support Static Libraries.
这两个平台还支持静态库。