Kenwood HP 9000 Personal Computer User Manual


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