Everything you need to understand dynamic libraries and static libraries

  • Ubuntu 14.04 LTS
  • GCC compiler
  • VM(Virtual Machine) and Vagrant
  • Knowledge Basic handling Linux OS +14.04 LTS
  • Some shell
  • Knowledge basics in C programming language.
  • Knowledge basic Compiler’s steps (but, not mandatory).

Libraries

Every time we create files and functions in our day by day as programmers, we notice that some functions can be used more than once in the different files that we are creating, for example:
We can have several files that call the functions we’ve created before: add, sub, mul, div.
we’ve noticed that we’re writing over and over the same code in the different directories that we’re working on.
So, this is what libraries for? Yes, it’s right.
before further going, we define what are libraries in computer science?

  • Let’s don’t have that to write the same code over and over or (to do copy-paste).
  • Let’s don’t have compiler again the functions.
  • The already compiled code is tested and reliable to use.
  • shared: say it to the compiler that we want to create a shared library or dynamic library.
    *.o: Apply all file that ends with .o
    -o: tell it to the compiler that we want a name specific for our library.
    libmylibrary.so: it’s the name assigned to our library.

--

--

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
Victor Zuluaga

Victor Zuluaga

I like to trip, to eat and to study software’s development. I usually self-study in my time free, because I like to learn things news.