-main

Purpose

Makes xxx the first file in the list of files that are passed to the linker. The purpose of this option is to make the specified file the main program in the executable file. xxx must uniquely identify the object file or the archive library, and the suffix must be either .o or .a, respectively.

If -main is not specified, the first object, archive library, or source file specified in the command is the first file in the list of files that are passed to the linker.

If the syntax of -main:xxx is invalid, or if xxx is not the name of an object or source file that is processed by the command, the command terminates.

This option applies only to linking.

Syntax

Read syntax diagramSkip visual syntax diagram-main:directory_name

Defaults

The -main option is not specified.