Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

xcode

ios

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?

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?

like image 598
chetan Avatar asked Nov 22 '11 08:11

chetan


People also ask

What is .a file in IOS?

an . a file is generally a precompiled library file. The . h files will have the definition of all the classes inside the . a file.

How do I view a .a file?

Microsoft Notepad It also has a simple built-in logging function. Each time a file that initializes with . log is opened, the program inserts a text timestamp on the last line of the file. It accepts text from the Windows clipboard.

What is .a file in Objective C?

A . a file is a compiled static library file (aka archive). It does not contain any source code, only object code for one or more architectures.


1 Answers

.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.

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.

like image 133
Mat Avatar answered Oct 02 '22 23:10

Mat