Building From the Command Line
The Cω compiler can be invoked at the command line by typing the name of its executable file (cwc.exe) at the command line.
This topic provides details on the following:
Using the Cω Command Prompt
The Cω Command Prompt window simplifies command-line use by providing a shortcut to a Windows command prompt window with path and environment variables changes needed to invoke the Cω compiler (cwc.exe) from any subdirectory on your computer.
To use the Cω Command prompt window
- From the Start menu, click Programs, point to Comega, point to Tools, and then click Comega Command Prompt.
- For quick help on using the Cω compiler, type cwc /? at the command line.
Rules for Command-Line Syntax
The Cω compiler code uses the following rules when interpreting arguments given on the operating system command line:
- Arguments are delimited by white space, which is either a space or a tab.
- The caret character (^) is not recognized as an escape character or delimiter. The character is handled completely by the command-line parser in the operating system before being passed to the argv array in the program.
- A string surrounded by double quotation marks ("string") is interpreted as a single argument, regardless of white space contained within. A quoted string can be embedded in an argument.
- A double quotation mark preceded by a backslash (\") is interpreted as a literal double quotation mark character (").
- Backslashes are interpreted literally, unless they immediately precede a double quotation mark.
- If an even number of backslashes is followed by a double quotation mark, one backslash is placed in the argv array for every pair of backslashes, and the double quotation mark is interpreted as a string delimiter.
- If an odd number of backslashes is followed by a double quotation mark, one backslash is placed in the argv array for every pair of backslashes, and the double quotation mark is "escaped" by the remaining backslash, causing a literal double quotation mark (") to be placed in argv.
Sample Command Lines
- Compiles File.cw producing File.exe:
cwc File.cw
- Compiles File.cw producing File.dll:
cwc /target:library File.cw
- Compiles File.cw and creates My.exe:
cwc /out:My.exe File.cw
- Compiles all of the Cω files in the current directory, with optimizations enabled and defines the DEBUG symbol. The output is File2.exe:
cwc /define:DEBUG /optimize /out:File2.exe *.cw
- Compiles all of the Cω files in the current directory producing a debug version of File2.dll. No logo and no warnings are displayed:
cwc /target:library /out:File2.dll /warn:0 /nologo /debug *.cw
- Compiles all of the Cω files in the current directory to Something.xyz (a DLL):
cwc /target:library /out:Something.xyz *.cw
See Also
Cω Compiler Options | Cω Compiler Options Listed Alphabetically | Cω Compiler Options Listed by Category