Search code examples
cgccshared-libraries

What is a file with extension .a?


I downloaded this: https://github.com/mongodb/mongo-c-driver

And now I'm trying to use it inside my C program, but I don't know what to do with the generated .a files. What are they? I couldn't find any information, not even in the GCC manual.

And I built it like so:

  scons --c99

Also, can I use C99 libraries with my C89 program?


Solution

  • .a files are static libraries typically generated by the archive tool. You usually include the header files associated with that static library and then link to the library when you are compiling.