Finding objects and libraries

Objects and libraries are linked together by the driver to produce an executable program. These modules may be divided into three classes: (1) objects that are produced by the compiler as a result of a compilation; (2) objects that are specified on the compiler command line by the user; (3) libraries.

The driver needs to know where to get these files to create a command line for the linker. It knows where type (1) objects are (since it created them). Type (2) objects must be fully specified either as absolute or relative paths. Libraries can be specified either by their full names or using the -L/-l combination.

m3 does not have a built-in default search path for libraries. The search path provided by m3build contains the standard SRC Modula-3 libraries.

When linking a program, m3 adds a built-in list of standard libraries (e.g. the C math library). This list of libraries is part of the m3build configuration. The -nostd option stops the automatic addition of these libraries.

If the -Z option has been specified, an object that collects and dumps the coverage tables is added to the list of files to be linked. The name of this object is part of the m3build configuration.


[Modula-3 home page]

m3-request@src.dec.com
Last modified on Mon Sep 25 18:31:51 PDT 1995 by heydon
     modified on Thu Apr 21 14:56:29 PDT 1994 by kalsow
     modified on Fri Feb  7 00:38:19 PST 1992 by muller