Go to the first, previous, next, last section, table of contents.
`link' mode links together object files (including library
objects) to form another library or to create an executable program.
mode-args consist of a command using the C compiler to create an
output file (with the `-o' flag) from several object files.
The following components of mode-args are treated specially:
- `-allow-undefined'
-
If output-file is a libtool library, allow it to contain
references to symbols that aren't defined in that library or its
dependencies (see section Inter-library dependencies).
- `-export-dynamic'
-
Allow symbols from output-file to be resolved with
dlsym(3)
(see section Dlopened modules).
- `-Llibdir'
-
Search libdir for required libraries that have already been
installed.
- `-lname'
-
output-file requires the installed library `libname'.
This option is required even when output-file is not an
executable.
- `-o output-file'
-
Create output-file from the specified objects and libraries.
- `-rpath libdir'
-
If output-file is a library, it will eventually be installed in
libdir.
- `-static'
-
If output-file is a program, then do not link it against any
shared libraries. If output-file is a library, then only create a
static library.
- `-version-info current[:revision[:age]]'
-
If output-file is a libtool library, use library version
information current, revision, and age to build it.
If not specified, each of these variables defaults to 0
(see section Library interface versions).
If the output-file ends in `.la', then a libtool library is
created, which must be built only from library objects (`.lo' files).
The `-rpath' option is required. In the current implementation,
libtool libraries may not depend on other uninstalled libtool libraries
(see section Inter-library dependencies).
If the output-file ends in `.a', then a standard library is
created using ar
and possibly ranlib
.
If output-file ends in `.o' or `.lo', then a reloadable object
file is created from the input files (generally using `ld -r').
This method is often called partial linking.
Otherwise, an executable program is created.
Go to the first, previous, next, last section, table of contents.