什么是.a(如libcrypto.a)文件? [英] What is a .a (as libcrypto.a) file?

查看:257
本文介绍了什么是.a(如libcrypto.a)文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.a (例如libcrypto.a)文件究竟是什么?它们包含哪些内容?是 .m 还是 .o .h .c files?

What exactly are .a (e.g. libcrypto.a) files and what do they consists of? Is it .m or .o or .h or .c files?

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

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

推荐答案

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

.a files are static library files. They "contain" one or more .o files, 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.

ar 实用程序和链接器( ld )生成> .a 文件(通常)由编译器调用它知道它们的格式以及如何从存档和可执行文件中提取相关的代码片段。

The .a files are produced with the ar utility, 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(如libcrypto.a)文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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