5.1.1 Driver Command-line Format
The compilation driver program (xc32-gcc) compiles, assembles
and links C and assembly language modules and library archives.
The xc32-g++ driver must be used when the
module source is written in C++. Most of the compiler command
line options are common to all implementations of the GCC
toolset; a few are specific to the compiler.
xc32-gcc [options] files libraries
xc32-g++ [options] files librarieshello.c, creating the executable
file hello.elf,execute this
command:xc32-gcc -o hello.elf hello.chello.elf,
execute:xc32-g++ -o hello.elf hello.cppThe available options are described in Driver Option Descriptions. It is conventional
to supply options (identified by a leading dash “-”
before the filenames), although this is not mandatory.
The files may be any mixture of C/C++ and assembler
source files, relocatable object files (.o) or
archive files. The order of the files is important. It may
affect the order in which code or data appears in memory or the
search order for symbols. Typically archive files are specified
after source files. The file types are described in Input File Types.
The libraries is a list of user-defined object
code library files that will be searched by the
linker, in addition to the standard C libraries.
The order of these files will determine the order
in which they are searched. They are typically
placed after the source filenames, but this is not
mandatory.
It is assumed in this manual that the compiler applications are either in the console’s search path, the appropriate environment variables have been specified, or the full path is specified when executing any application.
