Invocation syntax
You can use the compiler and linker either from the IDE or from the command line. See the IDE Project Management and Building documentation for information about using the build tools from the IDE.
Compiler invocation syntax
The invocation syntax for the compiler is:
iccrx [options] [sourcefile] [options]
For example, when compiling the source file prog.c, use this command to generate an object file with debug information:
iccrx prog.c ‑‑debugThe source file can be a C or C++ file, typically with the filename extension c or cpp, respectively. If no filename extension is specified, the file to be compiled must have the extension c.
Generally, the order of options on the command line, both relative to each other and to the source filename, is not significant. There is, however, one exception: when you use the -I option, the directories are searched in the same order as they are specified on the command line.
If you run the compiler from the command line without any arguments, the compiler version number and all available options including brief descriptions are directed to stdout and displayed on the screen.
Linker invocation syntax
The invocation syntax for the linker is:
ilinkrx [arguments]
Each argument is either a command line option, an object file, or a library.
For example, when linking the object file prog.o, use this command:
ilinkrx prog.o ‑‑config configfileIf no filename extension is specified for the linker configuration file, the configuration file must have the extension icf.
Generally, the order of arguments on the command line is not significant. There is, however, one exception: when you supply several libraries, the libraries are searched in the same order that they are specified on the command line. Any default libraries are always searched last.
The output executable image will be placed in a file named a.out, unless the linker option ‑‑output or -o is used.
If you run the linker from the command line without any arguments, the linker version number and all available options including brief descriptions are directed to stdout and displayed on the screen.
Passing options
There are three different ways of passing options to the compiler and linker:
Directly from the command line
Specify the options on the command line after the
iccrxorilinkrxcommands, see Invocation syntax.Via environment variables
The compiler or linker automatically appends the value of the environment variables to every command line, see Environment variables.
Via a text file, using the
-foption, see -f.
For general guidelines for the options syntax, an options summary, and a detailed description of each option, see Compiler options and Linker options.
Environment variables
These environment variables can be used with the compiler:
Environment variable | Description |
|---|---|
Specifies directories to search for include files, for example: | |
Specifies command line options, for example: |
This environment variable can be used with ILINK:
Environment variable | Description |
|---|---|
Specifies command line options, for example: |