Friday, October 12, 2007

Why we need libraries in C and how do you create them?

Link to the article:

http://users.actcom.co.il/~choo/lupg/tutorials/libraries/unix-c-libraries.html

1. The c language is a very basic construct with just the language syntax.
2. All the other functionalities are accessed through the libraries.
3. Advantage of the dynamic library is that multiple programs can access the same library at one time and this will save a lot of memory.
4. You do not need to compile each program separately if you change one library.
5. Static library if just the grouping together of the all the object files. Like libstdc++.a is the grouping of math.o string.o stdlib.o ect
6. The static library is created using the "ar" command which just groups the .o files together.
Like ar rc libutil.a util_file.o util_net.o util_math.o
7. Share lib can be Position independent code or can be Library file creation which is platform dependent.


Powered by ScribeFire.

No comments: