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 -o file_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.

The format of the a.out file is described in the AIX Files Reference.


Object files The compiler gives object files a .o suffix, for example, file_name.o, unless the -o file_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 .u suffix, for example, conversion.u.

The file contains targets suitable for inclusion in a description file for the make command. A .u 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. .u files are not created for any other files (unless you use the -+ option so other file suffixes are treated as .C files).

Related information