c

Applies to C Applies to C++

Purpose

Instructs the compiler to pass source files to the compiler only.

Syntax


Syntax Diagram

Notes

The compiled source files are not sent to the linkage editor. The compiler creates an output object file, file_name.o, for each valid source file, such as file_name.c, file_name.i, file_name.C, file_name.cpp, etc.

The -c option is overridden if either the -E, -P, or -qsyntaxonly options are specified.

The -c option can be used in combination with the -o option to provide an explicit name of the object file that is created by the compiler.

Example

To compile myprogram.C to produce an object file myprogram.o, but no executable file, enter the command:

xlc++ myprogram.C -c

To compile myprogram.C to produce the object file new.o and no executable file, enter:

xlc++ myprogram.C -c -o new.o

Related References

Compiler Command Line Options
E
o
P
syntaxonly IBM Copyright 2003