Types of Output Files

You can specify the following types of output files when invoking the XL C/C++ compiler.

Executable Files By default, executable files are named a.out. To name the executable file something else, use the -ofile_name option with the invocation command. This option creates an executable file with the name you specify as file_name. The name you specify can be a relative or absolute path name for the executable file.

 

Object Files The compiler gives object files a .o suffix, for example, file_name.o, unless the -ofile_name option is specified giving a different suffix or no suffix at all.

If you specify the -c option, an output object file, file_name.o, is produced for each input source file file_name.x, where x is a recognized C or C++ filename extension. The linkage editor is not invoked, and the object files are placed in your current directory. All processing stops at the completion of the compilation.

You can link-edit the object files later into a single executable file by invoking the compiler.

 

Assembler Files Assembler files must have a .s suffix, for example, file_name.s.

They are created by specifying the -S option. Assembler files are assembled to create an object file.

 

Preprocessed Source Files Preprocessed source files have a .i suffix, for example, file_name.i.

To make a preprocessed source file, specify the -P option. The source files are preprocessed but not compiled. You can also redirect the output from the -E option to generate a preprocessed file that contains #line directives.

A preprocessed source file, file_name.i, is produced for each source file and has the same file name (with a .i extension) as the source file from which it was produced.

 

Listing Files Listing files have a .lst suffix, for example, file_name.lst.

Specifying any one of the listing-related options to the invocation command produces a compiler listing (unless you have specified the -qnoprint option). The file containing this listing is placed in your current directory and has the same file name (with a .lst extension) as the source file from which it was produced.

 

Shared Library Files Shared library files have a .so suffix, for example, my_shrlib.so.

 

Target Files Output files associated with the -M or -qmakedep options have a .d suffix, for example, conversion.d.

The file contains targets suitable for inclusion in a description file for the make command. A .d file is created for every input C or C++ file, and is used by the make command to determine if a given input file needs to be recompiled as a result of changes made to another input file. .d files are not created for any other files (unless you use the -+ option so other file suffixes are treated as .C files).

Related Concepts

Types of input files

Related References

c
E
M
makedep
o
P
print
S IBM Copyright 2003