xcode 什么是 .a(作为 libcrypto.a)文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8224035/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:31:06  来源:igfitidea点击:

What is a .a (as libcrypto.a) file?

iosxcode

提问by chetan

What exactly are .a(e.g. libcrypto.a) files and what do they consists of? Is it .mor .oor .hor .cfiles?

到底什么是.a(例如 libcrypto.a)文件,它们由什么组成?它是.m.o.h.c文件?

How does IOS SDK/Xcode understands them? And if we include the .afile in our xcode project, do we need to copy the correspondng sources file too?

IOS SDK/Xcode 如何理解它们?如果我们将.a文件包含在我们的 xcode 项目中,我们是否也需要复制相应的源文件?

回答by Mat

.afiles are static libraryfiles. They "contain" one or more .ofiles, i.e. compiled code. To use them, you (often) need the header (.h) files that correspond to the compiled code, but you do not need the source code (.c, .m) itself.

.a文件是静态库文件。它们“包含”一个或多个.o文件,即编译后的代码。要使用它们,您(通常)需要与.h编译代码相对应的头文件( ),但不需要源代码 ( .c, .m) 本身。

The .afiles are produced with the arutility, and the linker (ld) that is (usually) invoked by your compiler knows their format and how to extract the relevant pieces of code from the archive and into your executable.

这些.a文件是使用ar实用程序生成的,并且ld(通常)由您的编译器调用的链接器 ( ) 知道它们的格式以及如何从存档中提取相关代码段并将其提取到您的可执行文件中。