Command-line syntax

You invoke the compiler using the following syntax:

Read syntax diagramSkip visual syntax diagramibm-clangibm-clang++-m64ibm-clang64ibm-clang++64command_line_optionsinput_files

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

In addition to invoking the C/C++ compiler, the ibm-clang, ibm-clang++, ibm-clang64, and ibm-clang++64 commands can also invoke the ld utility, which invokes the binder. These invocation commands can also invoke the as utility, which processes the HLASM assembly files.

Your program can consist of several input files. All of these source files can be compiled at once using only one command line of the compiler. Although more than one source file can be compiled using a single command line 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 binder. It passes binder options to the binder. Consequently, the invocation commands also accept all binder 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. The binder is not invoked. You can use a separate command to link all object files into an executable whose name can be specified by the -o option.

Related information