Name

Compiler, dcc32.exe

Usage

dcc32 [-Aunit=alias] [-B] [-CC] [-CG] [-Dsyms] [-Edirectory]
  [-Faddress] [-GD] [-GP] [-GS] [-H] [-Ipaths] [-J] [-JP] [-Kaddr]
  [-LEdirectory] [-LNdirectory]
  [-LUpackage] [-M] [-Ndirectory] [-Opaths] [-P] [-Q] [-Rpaths] [-TXext]
  [-Upaths] [-V] [-VN] [-VR] [-W] [-Z] [-$A+|-] [-$B+|-] [-$C+|-]
  [-$D+|-] [-$G+|-] [-$H+|-] [-$I+|-] [-$J+|-] [-$L+|-]
  [-$M+|-|minStackSize[,maxStackSize]] [-$O+|-] [-$P+|-]
  [-$Q+|-] [-$R+|-] [-$T+|-] [-$U+|-] [-$V+|-] [-$W+|-]
  [-$X+|-] [-$Y+|-YD] [-$Z+|-|1|2|4] file... [options...]

Description

dcc32.exe is Delphi’s command-line compiler. It uses the same compiler as the IDE, but you run the program from a command prompt. To control the compiler, you must supply options on the command line or in a configuration (.cfg ) file. The IDE automatically creates a configuration file for every project, so it is easy to compile a project or unit from the command line using the same options you use in the IDE.

You can mix options and filenames in any order on the command line. The compiler reads all the options before it starts to compile any of the files. The filenames can be any program, library, unit, or package source files. Unlike the IDE, with the command-line compiler, you can compile a single unit (.pas) source file. If a filename is that of a project, library, or package, the compiler also links the necessary units into the final .exe, .dll, or .bpl file. If you omit the extension from a source filename, Delphi tries .pas, then .dpr. To compile a package, you must supply the .dpk extension.

If you do not list any filenames on the command line, the compiler prints a brief summary of its options and usage.

The compiler gets options from four places. It checks all four sources, in order, so later sources can override earlier ones:

  • The global configuration file, dcc32.cfg, is in Delphi’s bin directory. You can modify this file to store options that apply to all projects. For example, you might use -u to list directories where Delphi should look for .dcu files.

  • The local configuration file, dcc32.cfg, is in the current directory.

  • The project configuration file resides in the same directory as the project source file. Its filename is the project filename, with the .cfg extension. Note that the IDE automatically creates a .cfg file for each project, saving the project’s options in the configuration file.

  • You can override the options in the configuration files by specifying additional or different options on the command line. The options can precede or follow the source filename.

A configuration file can contain any number of command-line options on any number of lines. For maximum clarity, it is best to put separate options on separate lines.

Each option switch can start with a hyphen (-) or a slash (/ ). If you use a slash, you can concatenate options into a single command-line argument, but if you use a hyphen, you must separate options with spaces. In either case, you can use single-letter compiler directive switches as command-line switches, e.g., -$A+. Combine compiler directive switches by separating them with commas, e.g., -$A+,B+,M-. Switches are not case sensitive, so /H is the same as /h.

Tip

Be careful when using directive switches with the command-line compiler. Unlike compiler directives that are embedded in source code, directive switches on the command line and in .cfg files are not subject to error checking. Any letter is allowed as a switch name, and invalid switches are ignored. Any character is allowed after the switch letter, and most characters mean the same as +.

You can list any number of filenames on the command line. The compiler compiles the source files one at a time. If a source file uses other units, the compiler ensures that those units are up to date and compiles them first, if necessary.

Unlike the IDE, the command-line compiler does not compile resource scripts listed in $R and $Resource compiler directives. You must run the resource compiler separately. (The next section covers the resource compiler.)

The rest of this section lists all the command-line options:

-A unit=alias ;...

Create a unit alias so any use of unit in a unit’s uses declaration is actually a reference to alias. This option is used most often when a new version of a unit has a different name than an earlier version of the unit. You can list multiple unit-alias pairs by separating them with a semicolon, for example, -AWinTypes=Windows;WinProcs=Windows.

-B

Build all used units even if the .dcu files are up to date. Another way to force Delphi to compile all the units in a project is to delete the project’s .dcu files first.

-CC

Create a console application ($AppType Console compiler directive).

-CG

Create a GUI application ($AppType GUI compiler directive).

-D sym1 ; sym2 ;...

Define sym1, sym2, and so on, as conditional compilation symbols. Define multiple symbols by separating them with a semicolon (;). The -D option is equivalent to using the $Define compiler directive.

-E directory

Store the output .exe or .dll file in directory. The default is the current directory.

-F address

Find the source line that corresponds to the address you get from a runtime error dialog box. If your application reports an error at an address, and you want to locate the source of the error, rebuild the project with the exact same options as you used earlier, but with the -F switch. The compiler requires debug information (-$D+) in order to locate the source line number.

-GD

Create a detailed .map file that lists the segments, public symbols, and code addresses for every line number of every unit that has debug information enabled ($DebugInfo compiler directive). The map file is stored in the project’s output directory (-E or -LE option) and has the same name as the project, but with the .map extension.

-GP

Create a medium-sized .map file that lists all segments and public symbols. The map file is stored in the project’s output directory (-E or -LE option) and has the same name as the project, but with the .map extension.

-GS

Create a small .map file that lists only the segments, that is, the starting address and size for each unit’s code and data segments. The map file is stored in the project’s output directory (-E or -LE option) and has the same name as the project, but with the .map extension.

-H

Generate compiler hints ($Hints compiler directive).

-I paths

Search for source files in the directories listed in paths. Separate directory names with semicolons.

-J

Generate a C .obj file in addition to a .dcu file for each unit.

-JP

Generate a C++ .obj file in addition to a .dcu file for each unit.

-K addr

Set the image base to the integer addr ($ImageBase compiler directive). For example, -K$400000.

-LE directory

Store output .bpl files in directory. The default is the current directory.

-LN directory

Store output .dcp files in directory. The default is the current directory.

-LU package

Link using the runtime package package. The project links dynamically with the units in package and does not include a copy of the units in the project’s .exe or .dll file.

-M

Make the unit files, that is, compile them only if needed.

-N directory

Store output .dcu files in directory. The default is the current directory.

-O paths

Search for .obj files in the directories listed in paths. Separate directory names with semicolons.

-P

Search for a unit by its short (8.3) filename in addition to its long name. Use this option if the files are stored on a filesystem that does not support long filenames, such as an old NetWare file server.

-Q

Compile quietly and do not list filenames as they are compiled.

-R paths

Search for .res files in the directories listed in paths. Separate directory names with semicolons.

-TX ext

Set the extension of the output file to ext. Unlike the $E compiler directive (which works only for libraries), the -TX option applies to programs and libraries. If you omit a leading dot (.) in ext, the compiler automatically inserts one. For example, -TXscr.

-U paths

Search for .dcu files in the directories listed in paths. Separate directory names with semicolons.

-V

Store Turbo Debugger information in the .exe, .dll, or .bpl file. Delphi’s integrated debugger does not use this information—only Turbo Debugger does. Using this option increases the size of the file considerably, but does not impact runtime performance.

-VN

Generate C++ namespaces. Use this option only if you intend to use the Delphi unit in a C++ project, because it increases the size of the output file and compile time.

-VR

Generate remote debugger symbols (.rsm file). Using this option does not affect the project’s .exe or .dll file, but the .rsm file can be large. Use this option only when you are using Borland’s remote debugger.

-W

Generate compiler warnings ($Warnings compiler directive).

-Z

Disable implicit building of low-level packages ($ImplicitBuild compiler directive).

-$A-

-$A+

Align record, class, and object fields ($Align compiler directive). Default is -$A+.

-$B-

-$B+

Evaluate Boolean expressions without using short-circuiting ($BoolEval compiler directive). Default is -$B-.

-$C-

-$C+

Compile assertions ($Assertions compiler directive). Default is -$C+.

-$D-

-$D+

Generate debug information to store in the .dcu file ($DebugInfo compiler directive). Default is -$D+.

-$G-

-$G+

This option is not implemented (see the $ImportedData compiler directive for an explanation). Default is -$G+.

-$H-

-$H+

The string type means AnsiString. Disable this option to make string be the same as ShortString ($LongStrings compiler directive). Default is -$H+.

-$I-

-$I+

Enable I/O checking so failures of input and output subroutines cause runtime errors ($IOChecks compiler directive). Default is -$I+.

-$J-

-$J+

Typed const declarations are writable at runtime ($WriteableConst compiler directive). Default is -$J+.

-$L-

-$L+

Store local symbol information as part of a .dcu file’s debug information ($LocalSymbols compiler directive). Default is -$L+.

-$M-

-$M+

Generate runtime type information for all class declarations ($TypeInfo compiler directive). Default is -$M-.

-$M minStackSize

-$M minStackSize , maxStackSize

Set the minimum stack size ($MinStackSize compiler directive) and optionally the maximum stack size ($MaxStackSize compiler directive). Default is 16384 and 1048576 bytes (-$M$4000,$100000).

-$O-

-$O+

Enable compiler optimization ($Optimizations compiler directive). Default is -$O+.

-$P-

-$P+

ShortString subroutine parameters are treated as OpenString parameters ($OpenStrings compiler directive). Default is -$P+.

-$Q-

-$Q+

Enable integer and enumeration overflow checking ($OverflowChecks compiler directive). Default is -$Q-.

-$R-

-$R+

Enable array bounds checking ($RangeChecks compiler directive). Default is -$R-.

-$T-

-$T+

The @ operator returns a typed pointer ($TypedAddress compiler directive). Default is -$T-.

-$U-

-$U+

Perform safe floating-point division, avoiding the infamous Pentium FDIV bug ($SafeDivide compiler directive). Default is -$U-.

-$V-

-$V+

When disabled, loosens restrictions on var string parameters to allow short string arguments whose maximum size does not match the parameter’s maximum size ($VarStringChecks compiler directive). Default is -$V+.

-$W-

-$W+

Generate stack frames ($StackFrames compiler directive). Default is -$W-.

-$X-

-$X+

Enable Pascal syntax extensions ($ExtendedSyntax compiler directive). Default is -$X+.

-$Y-

-$Y+

-$YD

Generate debug and reference information ($ReferenceInfo and $DebugInfo compiler directives). Default is -$Y+.

-$Z-

-$Z+

-$Z1

-$Z2

-$Z4

Set the minimum size of enumerated types to 1, 2, or 4 bytes ($MinEnumSize compiler directive). -$Z- means -$Z1, and -$Z+ means -$Z4. Default is -$Z1.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset