Dynamic libraries in C

Img 1: Static and dynamic libraries in C
img2 : How libraries work
gcc -c *.c
ar -rc libholberton.a *.o
gcc main.c -L. -lholberton -o main

Dynamic libraries:

gcc -fPIC -c *.c
Img 3: Writing gcc -fPIC -c *.c
gcc *.o -shared -o libholberton.so
Img 4: writing gcc *.o -shared -o libholberton.so
gcc 0-main.c -L. -lholberton -o len
Img 5: main function
Img 6: compiling and creating our dynamic library
Img 7: writind nm command
Img 8: writing env varaible and ldd command.
Img 9: graphical diferences between static and dynamic libraries

Static Libraries:

Dynamic Libraries:



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
Valentina Gómez A.

Valentina Gómez A.

Hi I am a financial engineer, and a software development student in Holberton School!