DCC32.EXE, the Delphi Command Line Compiler

From RAD Studio XE3
Jump to: navigation, search

Go Up to Command Line Utilities Index


DCC32.EXE is the Delphi (Object Pascal) command line compiler.

Versions of the Delphi Command Line Compiler

  • The Delphi (Object Pascal) command line compiler for 32-bit Windows is DCC32.exe, which is described in this topic.
  • The Delphi cross compiler for 64-bit Windows is DCC64.exe.
  • The Delphi cross compiler for Mac OS X is DCCOSX.exe.

Displaying Command Line Help

To display command line help, enter:

dcc32

or:

dcc32 -h

or:

dcc32 -help


Example

 C:\>dcc32
 Embarcadero Delphi for Win32 compiler version 23.0
 Copyright (c) 1983,2011 Embarcadero Technologies, Inc.
 
 Syntax: dcc32 [options] filename [options]
 
   -A<unit>=<alias> = Set unit alias
   -B = Build all units             
   -CC = Console target             
   -CG = GUI target                 
   -D<syms> = Define conditionals   
   -E<path> = EXE/DLL output directory
   -F<offset> = Find error          
   -GD = Detailed map file          
   -GP = Map file with publics      
   -GS = Map file with segments     
   -H = Output hint messages        
   -I<paths> = Include directories  
   -J = Generate .obj file          
   -JPHNE = Generate C++ .obj file, .hpp file, in namespace, export all
   -JL = Generate package .lib, .bpi, and all .hpp files for C++
   -K<addr> = Set image base addr   
   -LE<path> = package .bpl output directory
   -LN<path> = package .dcp output directory
   -LU<package> = Use package       
   -M = Make modified units         
   -N0<path> = unit .dcu output directory
   -NH<path> = unit .hpp output directory
   -NO<path> = unit .obj output directory
   -NB<path> = unit .bpi output directory
   -NS<namespaces> = Namespace search path
   -O<paths> = Object directories   
   -P = look for 8.3 file names also
   -Q = Quiet compile               
   -R<paths> = Resource directories 
   -U<paths> = Unit directories     
   -V = Debug information in EXE    
   -VR = Generate remote debug (RSM)
   -VT = Debug information in TDS   
   -W[+|-|^][warn_id] = Output warning messages
   -Z = Output 'never build' DCPs   
   -$<dir> = Compiler directive     
   --help = Show this help screen   
   --version = Show name and version
   --codepage:<cp> = specify source file encoding
   --default-namespace:<namespace> = set namespace
   --depends = output unit dependency information
   --doc = output XML documentation 
   --drc = output resource string .drc file
   --no-config = do not load default dcc32.cfg file
   --description:<string> = set executable description
   --inline:{on|off|auto} = function inlining control
   --peflags:<flags> = set extra PE Header flags field
   --peoptflags:<flags> = set extra PE Header optional flags field
   --peosversion:<major>.<minor> = set OS Version fields in PE Header (default: 5.0)
   --pesubsysversion:<major>.<minor> = set Subsystem Version fields in PE Header (default: 4.0)
   --peuserversion:<major>.<minor> = set User Version fields in PE Header (default: 0.0)
 Compiler switches: -$<letter><state> (defaults are shown below)
   A8  Aligned record fields         
   B-  Full boolean Evaluation       
   C+  Evaluate assertions at runtime
   D+  Debug information             
   G+  Use imported data references  
   H+  Use long strings by default   
   I+  I/O checking                  
   J-  Writeable structured consts   
   L+  Local debug symbols           
   M-  Runtime type info             
   O+  Optimization                  
   P+  Open string params            
   Q-  Integer overflow checking     
   R-  Range checking                
   T-  Typed @ operator              
   U-  Pentium(tm)-safe divide       
   V+  Strict var-strings            
   W-  Generate stack frames         
   X+  Extended syntax               
   Y+  Symbol reference info         
   Z1  Minimum size of enum types    
 Stack size: -$M<minStackSize[,maxStackSize]> (default 16384,1048576)

Creating C++ Files from DCC32

There are two ways to generate .hpp files and the other files C++ needs in order to use Delphi source code:

  • Use the -JL switch on the .dpk files. This generates .lib, .bpi, and .bpl files (.obj information is linked into the .lib) for the package and .hpp files for all units in the package.
  • Use the -JPHNE switch on the .pas file. This is useful when you need only an individual unit (.pas file).

Generating Debug Info

The -V option (Generate debug info) has several suboptions:

  • -V Generate debug info in the .exe file
  • -VN Generate debug info with namespace or unit scope name
  • -VR Generate debug info in .rsm file (for Delphi, set by the Include remote debug symbols option on the Project > Options > Delphi Compiler > Linking page)
  • -VT Generate debug info in .tds file (for C++, set by the Place debug information in separate TDS file option on the Project > Options > Delphi Compiler > Linking page)

The -VN option does not specify where the debug information is generated. For example, to generate debug information in the .exe file and to include the namespace or unit scope information, you need to specify two options in your DCC32 command, as follows:

-V -VN

See Also