Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

User Commands (c) c89(1)
Dynamic and Static Linking
The -WBdllsonly and -WBdynamic ags specify dynamic linking. The -WBstatic ag species
static linking. In dynamic linking:
The nld utility rst searches for a shared run-time library (SRL). If an SRL cannot be
found, nld then searches for an archive le. If neither of these les are found, an error is
issued. In static linking, nld searches for an archive le but does not search for an SRL.
The ld or eld utility rst searches for a dynamic-link library (DLL). If a DLL cannot be
found, the linker then searches for an archive le. If neither of these les are found, an
error is issued. In static linking, the linker searches for an archive le but does not
search for a DLL.
If the archive le cannot be found, an error is issued.
Dynamic and static linking are not exact opposites. Dynamic linking accepts either an SRL or
DDL or an archive, but static linking accepts only an archive.
Unlike other c89 ags, multiple -WBdllsonly, -WBdynamic, and -WBstatic ags can be
specied in a single c89 invocation. Thus, it is possible to perform dynamic linking for some -l
operands and static linking for others.
The -WBdllsonly, -WBdynamic, and -WBstatic ags specied to c89 affect linking arguments
specied in -Weld, -Weld_obey, -Wld, -Wnld, -Wld_obey,or-Wnld_obey ags. Each
specication remains in effect until another is encountered. To change how a linker performs
linking for such arguments, you can specify eld, ld,ornld ags that control linking within the
argument list. All linkers perform dynamic linking by default. Refer to the eld(1), ld(1),or
nld(1) reference page for more information.
Handling of Files in the Guardian File System
Files in the Guardian le system can be accessed using OSS pathname syntax
(/G/volume/subvol/leID).
c89 requires that les in the Guardian le system be identied with a sufx as is done in the OSS
le system. Because Guardian lenames do not allow the .sufx format, the period is dropped
and the sufx becomes the last character of the lename. However, the .sufx format must be
used when specifying the le to c89.
Thus, the Guardian le system le $VOL.SUBVOL.FILEC, which identies a C source le, is
specied to c89 as /G/VOL/SUBVOL/FILE.c. Likewise, c89 generates an object le
$VOL.SUBVOL.FILEO that can be specied to c89 again as /G/VOL/SUBVOL/FILE.o.
The default executable object le when the current working directory is in the Guardian le sys-
tem is aout.
Predened Preprocessor Symbols and Macros
c89 denes the following preprocessor symbols and feature-test macros:
__cplusplus
Directs the preprocessor to process the source text as C++ source code. c89 denes
this symbol if the -Wcplusplus ag is specied or the name of an OSS source le ends
in a C++ sufx(.ii, .C, .cpp, .c++, .cxx, .cc, .eC, .ecpp, .ec++, .ecc,or.ecxx).
_TANDEM_SOURCE
Makes visible to the preprocessor identiers required or permitted by extensions made
by HP. c89 denes this feature-test macro if the -Wextensions ag is specied.
527188-007 Hewlett-Packard Company 221