168 Chapter 5
Creating and Using Libraries
Caution When Mixing Shared and Archive Libraries
Figure 5-13
Next suppose you put f3.o into the shared library lib3.sl and f1.o
and f2.o into the archive library lib12.a:
$ ld -b -o lib3.sl f3.o Create a shared library.
$ ar qvc lib12.a f1.o f2.o Create an archive library.
Figure 5-14
Now link the main with the archive library and create the executable
a.out:
$ cc main.o lib12.a -ldld Link the program.