Show: Delphi C++
Display Preferences

C++ Compiler Precompiled Headers

From RAD Studio XE3
Jump to: navigation, search

Go Up to C++ Compiler Project Options

Project > Options > C++ Compiler > Precompiled headers

Use this dialog box to set C++ Compiler Precompiled headers options.

You might also want to read about and use the Precompiled Header Wizard.

Options Description

Target, Apply, Save

See Target Options.

Common items

See Common Items on Project Options Pages.



Precompiled Headers Options Description Compiler switches
bcc32 bcc64 bccosx

Cache precompiled headers

The compiler caches the precompiled headers it generates. This is useful when you are precompiling more than one header file. Default = False

-Hc (Must be used with -H or -H"xxx")

Platform not supported

-Hc (Must be used with -H or -H"xxx")

Enable smart cached precompiled headers

The compiler smart-caches the precompiled headers it generates (smart-caching uses less memory than the regular caching option -Hc). Caching header files in memory is useful when you are precompiling more than one header file. Default = True

-Hs

Platform not supported

-Hs

External type files

The compiler generates a file or files that contain debug type information for all the symbols contained in the precompiled headers. The files end with the .#xx extension, where xx is 00 for the first file generated and is incremented for each additional type-information file required.

Using this option dramatically decreases the size of your .OBJ files, since debug type information is centralized and is not duplicated in each .OBJ file. Default = True

-He

Platform not supported

-He

Include contents of

Includes the contents of the specified header file or files. Check the Inherit values from parent configuration(s) box to act as if the immediate ancestor's files are merged into this list of files, though this list is not actually changed. TheEllipsis pop-up button is described in Common Items on Project Options Pages.

-Hi

Platform not supported

-Hi

Inject precompiled header file

Includes the contents of the single header file that you specify, and then instructs the compiler to stop precompiling at the end of that header each time the compiler is invoked. Is equivalent to adding the following directives at the beginning of each .cpp file:

#include "myfile.h"
#pragma hdrstop

-Hi

Platform not supported

-Hi

PCH Filename

Specify the name of your precompiled header file. The compiler sets the name of the precompiled header to the specified filename. When this option is set, the compilers generate and use the precompiled header file that you specify.

WARNING: If you import a project from BDS2006, the project's PCH file location is not imported due to Windows Vista compatibility, since Vista restricts where users may place files. The Ellipsis pop-up button is described in Common Items on Project Options Pages.

-H=

Platform not supported

-H=

PCH Usage

See Precompiled Headers Overview.

Select from the following values:

  • Do not use Do not use precompiled headers.
  • Generate and use
    (-H) The IDE generates and uses precompiled headers. This is the default.
    • For both 32-bit Windows and 64-bit Windows, the IDE creates a precompiled header file with the following default file name:
      <projectname>PCH<n>.h
  • Use but don't generate
    (-Hu) Compilers use preexisting precompiled header files; new precompiled header files are not generated.

Do not use N/A

Generate and use -H

Use but don't generate -Hu

Do not use N/A

Generate and use -include-pch

Use but don't generate N/A

Do not use N/A

Generate and use -H

Use but don't generate -Hu

Replace header name(s):

Replaces header name from name1 to name2. The Ellipsis pop-up button is described n Common Items on Project Options Pages.

-Hr

Platform not supported

-Hr

Stop precompiling after

Terminates compiling the precompiled header after processing the specified file. You can use this option to reduce the disk space required for precompiled headers.

When you use this option, the file you specify must be included from a source file for the compiler to generate a .CSM file.

You can also use

#pragma hdrstop

within your .CPP files to specify when to stop the generation of precompiled headers.

You cannot specify a header file that is included from another header file. For example, you cannot list a header included by windows.h, because this would cause the precompiled header file to be closed before the compilation of windows.h was completed. The Ellipsis pop-up button is described in Common Items on Project Options Pages.

-Hh=

Platform not supported

-Hh=

See Also

Personal tools
Previous Versions
In other languages