|
|
The cc command line:
cc -dy file1.c file2.c file3.c
creates object files corresponding to each of your source files, and links them with each other to create an executable program. The standard C library that is first searched for in this arrangement (-dy) is a dynamically linked library called libc.so, which means that the functions you have called are linked with your program at run time. (There are some exceptions. Many C library functions have been left out of libc.so by design. If you use one of these functions in your program, the code for the function is incorporated in your executable at link time. The function still automatically linked with your program, only statically rather than dynamically.)
Now consider the formal basis for this arrangement:
directs the link editor to search the dynamically linked library libx.so, the archive library libx.a, or the static shared library liby_s. The cc command automatically passes -lc to the link editor.
Therefore, the cc command line directs the link editor to search /usr/ccs/lib/libc.so rather than its archive library counterpart.
libc.so
is one of the dynamically linked libraries
supplied by SCO OpenServer Development System.
Other dynamically linked libraries are also supplied
with the operating system, and usually are
kept in the standard places.
Of course, you can link your program
with libraries that
perform other tasks as well.
Finally, you can create your own dynamically or statically shared libraries,
and archive libraries.