问题描述
XCode中的静态库和动态库有什么区别?为什么Apple不允许我们在iOS应用程序中使用动态库?
What is the difference between a static and dynamic library in XCode? And why doesn't Apple allow us to use dynamic libraries in our iOS applications?
推荐答案
虽然您可以为Mac构建动态库OS X,你不能将它们用于iPhone开发。
While you can build dynamic libraries for Mac OS X, you cannot use them for iPhone development.
静态库只是一个目标文件的存档,它被拉入一个链接到它的程序中。链接器将取消归档所有归档文件,并在链接期间将其与其余目标文件一起拉入。
A static library is merely an archive of object files that gets pulled into a program linking against it. The linker will unarchive all the archive files, and pull them in during linking along with the rest of your object files.
然而,动态库会创建共享对象文件,类似于一个程序,但没有一个入口点,哪些程序可以链接和调用这些共享库中的符号,而不会将它们自身拉入。
A dynamic library however, creates a shared object file, akin to a program but without an entry point, which programs can link against and call out of themselves into these shared libraries for their symbols, without pulling them into itself.
这篇关于Xcode for iPhone中静态和动态库的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!