Any messages issued during the compilation are inserted in the listing file. A
listing file is useful for debugging the source code. Use the
produce a listing; you may also use
-machine_code
file.
Diagnostic messages provide information for you to determine the cause of an
error and correct it. If the compiler creates a listing file, it writes the messages to
the listing file.
1.2.3 Linking a Compaq COBOL Program on Tru64 UNIX
Once your program has compiled successfully, the system passes the resulting
object file (which has the suffix .o by default) to the linker to create an executable
image file. By default, the executable image file has the name a.out. (To change
this default, specify
on the Tru64 UNIX system.
The
linker provides the following primary functions:
ld
•
Generates appropriate information in the executable image for virtual
memory allocation
•
Resolves symbolic references among object files being linked, including
whether to search in archive or shared object libraries
•
Assigns values to relocatable global symbols
•
Performs relocation
The linker produces an executable program image with a default name of a.out.
When you enter a
a compilation error occurs or you specify the
1.2.3.1 Specifying Object Libraries for Linking
You can specify object libraries on the
flags or by providing the file name of the library. These object libraries are also
searched by
When
cobol
library file names to
names in a standard list of library directories. That is,
object library file name first in one directory, then in the second, and then in the
third directory on its search list of directories.
To display a list of the compilers invoked, files processed, and libraries accessed
during linking, specify the
In addition to an object file created by the compiler, any linker flags and object
files specified on the
linker loads object files according to the order in which they are specified on the
command line. Because of this, you must specify object libraries after all source
and object files on the
To help identify undefined references to routines or other symbols in an object
module, consider using the
the
command filtered by the
nm
% cobol -c ex.cob
% nm -o ex.o | grep U
Developing Compaq COBOL Programs
1.2 Developing Programs on Tru64 UNIX
,
, and/or
, all of which affect the contents of the listing
-map
-warn
-o
filename on the
command, the
cobol
for unresolved external references.
ld
specifies certain libraries to
ld
. The
ld
linker tries to locate each of these library file
flag.
-v
cobol
command are also passed to the
command line.
cobol
command. For instance, in the following example
nm
grep
,
-cross_reference
-copy_list
cobol
command line.) This file can be run
linker is invoked automatically unless
ld
flag on the command line.
-c
command line by using certain
COBOL
, it provides a standard list of COBOL
ld
attempts to locate each
ld
command lists all undefined (U) symbols:
Developing Compaq COBOL Programs 1–19
-V
or
-list
flag to
,
,
-flagger
ld
linker. The
Need help?
Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?