C++ User's Guide

-o filename

Sets the name of the output file or the executable file to filename.

Warnings

The filename must have the appropriate suffix for the type of file to be produced by the compilation. It cannot be the same file as the source file, since the CC driver does not overwrite the source file.