Compaq AAQ2G1FTK Marine Radio User Manual


 
Developing Compaq COBOL Programs
1.2 Developing Programs on Tru64 UNIX
If the symbol is undefined, U appears in the column before the symbol name. Any
symbols withaUintheir names can also be displayed by this use of
grep
.
1.2.3.2 Specifying Additional Object Libraries
You can control the libraries as follows:
To specify additional object library file names for
ld
to locate, use the
-l
string flag to define an additional object library for
ld
to search. Thus, each
occurrence of the
-l
string flag specifies an additional file name that is added
to the list of object libraries for
ld
to locate. The standard COBOL library file
names searched (shown in the form of the appropriate
-l
string flag) are:
-lcob
-lcurses
-lFutil
-lots2
-lots
-lisam
-lsort
-lexc
-lm
For instance, the file name of
-lcob
is
libcob
.
The following example specifies the additional library
libX
:
% cobol simtest.cob -lX
In addition to the standard directories in which
ld
tries to locate the library
file names, you can use the
-L
dir flag to specify another directory. The
-l
string flag and
-L
dir flag respectively adds an object library file name
(
-l
string) or directory path (
-L
dir) that
ld
uses to locate all specified library
files. The standard
ld
directories are searched before directories specified by
the
-L
dir flag.
The following example specifies the additional object library path
/usr/lib/mytest
:
% cobol simtest.cob -L/usr/lib/mytest
You can indicate that
ld
should not search its list of standard directories at
all by specifying the
-L
flag. When you do so, you must specify all libraries
on the
cobol
command line in some form, including the directory for
cobol
standard libraries. To specify all libraries, you might use the
-L
flag in
combination with the
-L
dir flag on the same
cobol
command line.
You can specify the pathname and file name of an object library as you
would specify any file. Specifying each object library that resides in special
directories in this manner is an alternative to specifying the library using the
-l
string or
-L
dir flag. This method can reduce the amount of searching the
linker must do to locate all the needed object files.
In certain cases, you may need to specify the pathname and file name instead
of using the
-l
string or
-L
dir flags for the linker to resolve global symbols
with shared libraries.
When processing a C source file (
.c
suffix) using the
cobol
command, you may
need to specify the appropriate C libraries using the
-l
string flag.
1–20 Developing Compaq COBOL Programs