next up previous contents index
Next: Applications Up: Software Development Previous: man page for

Creating and maintaining your own libraries

  If you have a lot of different object files you can create an archive   library to store them. The command ar is used to create and manage archive libraries. Its syntax is:
 
               		  ar  keys archive [obj_ files] 

The most important keys are r to replace or add modules to the archive and t to display a table of contents. The archive is a name composed of lib name.a. For example the command sequence:
 
               		  cc -c  func1.c

cc -c func2.c

cc -c func3.c

ar r libmy.a func1.o func2.o func3.o

compiles func1.c, func2.c, func3.c and adds the object files into the   libmy.a.



Alan Silverman
Wed Apr 12 16:54:02 METDST 1995