User`s manual

Dynamic C Users Manual digi.com 303
15. COMMAND LINE INTERFACE
The Dynamic C command line compiler (dccl_cmp.exe) performs the same compilation and program
execution as its GUI counterpart (dcrabxx.exe), but is invoked as a console application from a DOS
window. It is called with a single source file program pathname as the first parameter, followed by optional
case-insensitive switches that alter the default conditions under which the program is run. The results of
the compilation and execution, all errors, warnings and program output, are directed to the console win-
dow and are optionally written or appended to a text file.
Note that the command line compiler resides in the directory where you installed Dynamic C.
In the con-
sole window, you need to "cd" into the directory where the command line compiler resides. From
there you must type in the relative path of the sample you want to compile. Quotes are need if
there are spaces in the path. For example,
> cd c:\DCRabbit_9.24
> dccl_cmp samples\memory_usage.c
> dccl_cmp "c:\My Documents\my program.c"
15.1 Default States
The command line compiler uses the values of the environment variables that are in the project file indi-
cated by the -pf switch, or if the -pf switch is not used, the values are taken from default.dcp. For
more information, please see Chapter 16, “Project Files” on page 325.
The command line compiler will compile and run the specified source file. The exception to this is when
the project file “Default Compile Mode” is one of the options which compiles to a .bin file, in which case
the command line compiler will not run the program but will only compile the source to a .bin file. Com-
mand line help displayed to the console with
dccl_cmp
gives a summary of switches with defaults from the default project file, default.dcp, and
dccl_cmp -pf specified_project_name.dcp
gives a summary of switches with defaults from the specified project file. All project options including the
default compile mode can be overridden with the switches described in Section 15.4.
15.2 User Input
Applications requiring user input must be called with the -i option:
dccl_cmp myProgram.c -i myProgramInputs.txt
where myProgramInputs.txt is a text file containing the inputs as separate lines, in the order in
which myProgram.c expects them.