C Programming and Static Libraries

A vast library is a thing of beauty!

So what is a library?

The process of compiling for a C program.

Static vs. Dynamic Libraries

Making Libraries

$ gcc -c *.c
$ ar -rc libholberton.a *.o
$ ranlib libholberton.a
A peek into a C library…
nm libholberton.a

Using made libraries

  • -l<libraryname without the leading lib or the extension>
  • -L : specifies the path to the library. For the current working directory, we can use -L. If your library is not in your current directory use the path format -L/home/tmp or where ever your library is.
gcc main.c -L. -lholberton -o executable
./executable

--

--

--

Software engineer exploring tech

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Start running a process in Camunda (Quick start)

A SparkSql Editor via Hue and the Spark SQL Server

How Bitset Enables the Versatility of Vector Search

Bitset. Source: Image by author.

How to transition to Test-Driven Development (TDD)

This is how love breaks.

Hadoop / Spark Notebook and Livy REST Job Server improvements!

Implementing Progressive Web Applications for a prominent media group

Reasons To Migrate Codeigniter to Laravel

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tim Mcmacken Jr.

Tim Mcmacken Jr.

Software engineer exploring tech

More from Medium

How Objects behave with Variables and Methods

Package, Jars, and Deployment

OOPS in java

Java Course | Chapter 1 : Introduction