DLL Programmer's Guide for TNS/E Systems
Essential DLL Facility Controls
DLL Programmer’s Guide for TNS/E Systems—527252-006
2-11
Libraries the Linker Searches For and Opens
appropriate to the linker platform and then attempt to open the resulting file. This is
described in Augmenting Library Names Automatically in Searches on page 5-2.
A -lib option cannot specify any of the primary linkfiles in a link; these must be
inserted separately in the command stream as qualified file names or unqualified
names if the files are in the current directory.
Where The Linker Searches for Libraries and Archives
The following example adds a library, whose unqualified name is libfile1, to the
link.
ld linkfile1 linkfile2 archfile1 -lib libfile1 -dll -o mainout
If libfile1 were a qualified name, the linker would open it normally, just as it did for
the two linkfiles and the archive. However, since libfile1 is an unqualified name,
the linker searches for it, and the linker must know where in the file system to look for
it. This is defined by the linker search path, which specifies the sequence of directories
or subvolumes in which the linker searches for directly referenced libraries. This path is
specified by the following sequence in the order shown:
1. A directory or subvolume you specify in a -first_L <pathname > option in the
linker’s command stream, where <pathname > is a path to a specified directory or
subvolume. Only one path or directory can be inserted with each -first_L
option, so one such option must be inserted for each path or directory needed. The
linker searches the specified directories or subvolumes in the sequence that the
-first_L options are inserted.
2. The public libraries. Because the public libraries cannot store archives, the linker
will bypass this step if -b static is in effect, as discussed in Making the Linker
Accept Only DLLs or Only Archives on page 5-1.
3. The directory or subvolume you specify in a -libvol <pathname > option in the
linker’s command stream, where <pathname > is a path to a specified directory or
subvolume. -L, in upper case, is a synonym for -libvol. Only one path or
directory can be inserted with each -libvol option, so one such option must be
inserted for each path or directory needed. The linker searches the specified
directories or subvolumes in the sequence that the -libvol options are inserted.
4. For OSS, where the value of the environmental value COMP_ROOT prefixes each
of the following names:
when building a 32-bit or neutral object:
/lib:/usr/lib:/usr/local/lib:/G/SYSTEM/ZDLL
when building a 64-bit object:
/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/loca
l/lib:/G/SYSTEM/ZDLL
Finally, unless the -b static option is in effect, (see Making the Linker Accept
Only DLLs or Only Archives on page 5-1), the linker searches in
/G/SYSTEM/ZDLL.










