RAD Studio
ContentsIndex
PreviousUpNext
#pragma hdrstop

Syntax

#pragma hdrstop

Description 

This directive terminates the list of header files eligible for precompilation. You can use it to reduce the amount of disk space used by precompiled headers. 

Precompiled header files can be shared between the source files of your project only if the #include directives before #pragma hdrstop are identical. Therefore, you get the best compiler performance if you include common header files of your project before the #pragma hdrstop, and specific ones after it. Make sure the #include directives before the #pragma hdrstop are identical in all the source files, or that there are only very few variations. 

The integrated development environment generates code to enhance precompiled header performance. For example, after a New Application, source file "Unit1.cpp" will look like this (comments added):

#include <clxvcl.h>       // common header file
#pragma hdrstop      // terminate list here

Use this pragma directive only in source files. The pragma has no effect when it is used in a header file.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!