Wot is a user library? I hear you ask! Well, its a collection of your functions, that, when placed into a library are available to all the programs you write.
This is what Chris Sawtell has to say about libraries.
There are two types of library, dynamic and static. Although dynamic libraries are the prefered alternative (because they are not linked into your program), here is the method required to create static libraries....
There are several steps required in creating a library.
vi reverse.c # write your function (no main).
gcc -c reverse.c # -c just compiles (no link).
ar -q libmart.a reverse.o # -r == if nessasary replace
# an existing function.
gcc program.c -lmart -L/home/leslim # -l == library to search
# -L == Location of the library.
|
A few notes:
| Top | Master Index | Keywords | Functions |