| Syntax: | Default: |
| link(initializationTermination, [initf][, [finif][, priority]]) | priority defaults to 0 |
This option specifies an initialization and termination function for a module, where initf is an initialization routine, finif is a termination routine, and priority is a signed integer with values from -2,147,483,648 to 2,147,483,647. You must specify at least one of initf or finif. If you do not specify priority, 0 is the default.
This option sorts routines by priority, starting with the routine with the smallest (most negative) priority. It invokes initialization routines in order, and termination routines in reverse order.
It invokes routines with the same priority in an unspecified
order. However, if multiple link(initializationTermination)
options specify the same priority and both an initialization and
termination routine, it preserves the relative order of the
routines.
For example, if you specify link(initializationTermination,
i1, f1) and link(initializationTermination, i2, f2),
function i1 and i2 are invoked in an
unspecified order. However if i1 is invoked before
i2 when the module is loaded, f2 will be
invoked before f1 when the module is unloaded.
![]()
Incremental C++ Builds
C Compilation
Configuration
Files
