Sun Studio 12: C++ User's Guide

A.2.5 –c

Compile only; produce object .o files, but suppress linking.

This option directs the CC driver to suppress linking with ld and produce a .o file for each source file. If you specify only one source file on the command line, then you can explicitly name the object file with the -o option.

A.2.5.1 Examples

If you enter CC -c x.cc, the x.o object file is generated.

If you enter CC -c x.cc -o y.o, the y.o object file is generated.

Warnings

When the compiler produces object code for an input file (.c, .i), the compiler always produces a .o file in the working directory. If you suppress the linking step, the .o files are not removed.

See also

–o filename, –xe