BRCC32.EXE, the Resource Compiler

From RAD Studio
Jump to: navigation, search

Go Up to Command-Line Utilities Index

BRCC32 is the command-line version of the resource compiler. It accepts a resource script file (.RC) as input and produces a resource object file (.RES) as output.

RAD Studio provides a choice regarding resource compilers. You can choose to use either:

  • BRCC32
  • RC.EXE (the Windows SDK resource compiler)

You make this choice on the Project > Options > Resource Compiler dialog box.

When you select the Windows SDK resource compiler as your resource compiler, an intermediary compiler named CGRC.EXE is invoked, but CGRC, in turn, invokes RC.EXE.

However, on the command line you can use any of the three resource compilers:

  • BRCC32.EXE
  • CGRC.EXE
  • RC.EXE


Command-Line Syntax

BRCC32 [<options>] <filename>.RC

Command-Line Elements

Element Description

<options>

Command-line options. They are optional.

<filename>.RC

Defines a resource script file (.RC) to be compiled. This file should be specified.


To display command-line help, enter:

brcc32

Or add the help flag:

brcc32 -h

Command-Line Options

BRCC32.EXE supports the command-line options listed in the following table:


BRCC32 Command-Line Options

Option Description

-h or ?

Shows the help message.

@<response file>

Takes instructions from the specified command file.

-c<code page>

Uses the specified codepage code page for resource translation. If -c is not used, the default ANSI code page is used.

-d<name>[=<string>]

Defines the name preprocessor symbol, which you can test with the
#IFDEF name C++ preprocessor directive.

-fo<filename>

Defines the name for the output resource .RES file. (By default, BRCC32 creates the output .RES file with the same name as the input .RC file.)

-i<path>

Adds one or more directories (path separated by semicolons) to the include search path. For example:

-i"C:\Program Files (x86)\Embarcadero\Studio\23.0\lib\debug";C:\MyUnits

-l<language>

Specifies the default language.

-m

Indicates that the code page specified with the -c switch contains double-byte character set (DBCS) characters.

-r

This switch is ignored. It is included for compatibility with other resource compilers.

-v

Prints progress messages (verbose listing).

-x

Deletes the current include path.

-16

Builds 16-bit Windows-compatible .RES files.

-32

Builds 32-bit Windows-compatible .RES and .EXE files.
This is the default option.


BRCC32 predefines common resource-related Windows constants such as WS_VISIBLE and BS_PUSHBUTTON. Also, two special compiler-related symbols are defined: RC_INVOKED and WORKSHOP_INVOKED. These symbols can be used in the source text in conjunction with conditional preprocessor statements to control compilation.

For example, the following construct can greatly speed up compilation:

#ifndef WORKSHOP_INVOKED
#include "windows.h"
#endif

Downward Compatibility

The following syntax and options are supported for downward compatibility:

Option Description

-31

Builds Windows 3.1-compatible .RES files.

-w32

Builds Win32-compatible .RES files.


See Also