Command-line syntax

You invoke the compiler using the following syntax, where invocation can be replaced with any valid XL C invocation command listed in Table 1:

Read syntax diagramSkip visual syntax diagram
               .---------------------------------------.   
               V                                       |   
>>-invocation----input_files--+----------------------+-+-------><
                              '-command_line_options-'     

The parameters of the compiler invocation command can be the names of input files, compiler options, and linker options.

Your program can consist of several input files. All of these source files can be compiled at once using only one invocation of the compiler. Although more than one source file can be compiled using a single invocation of the compiler, you can specify only one set of compiler options on the command line per invocation. Each distinct set of command-line compiler options that you want to specify requires a separate invocation.

Compiler options perform a wide variety of functions, such as setting compiler characteristics, describing the object code and compiler output to be produced, and performing some preprocessor functions.

By default, the invocation command calls both the compiler and the linker. It passes linker options to the linker. Consequently, the invocation commands also accept all linker options. To compile without linking, use the -c compiler option. The -c option stops the compiler after compilation is completed and produces as output, an object file file_name.o for each file_name.nnn input source file, unless you use the -o option to specify a different object file name. The linker is not invoked. You can link the object files later using the same invocation command, specifying the object files without the -c option.

Related information