Pre-compiled Headers


A precompiled header is a (c and c++) header that is compiled into intermediate form that is faster to process for the computer.

Turbo C++ can generate (and subsequently use) pre-compiled headers for your

projects. Pre-compiled headers are header files that are compiled once, then used overand over again in their compiled state.


 Using Pre-compiled Headers

To control the use of pre-compiled headers, do one of the following: 1) Turn on the [X] Pre-compiled Headers option in the


Options -> Compiler-> Code Generation dialog box. The IDE bases the name of the pre-compiled header file on the project name,creating <project>.SYM


 2) Use the -H, -H=<filename>, and -Hu command-line options with TCC.EXE.


 3) Use the hdrfile and hdrstop pragmas inside your code.



  Code Generation dialog box this dialog box is where you select the memory model you'll be using and anyoptions you find necessary for the type of code you want to generate.
Model        

   ( ) Tiny    (・) Small    ( Default)   ( ) Medium     ( ) Compact    ( ) Large       ( ) Huge     




The Model options determine which memory model you want to use. 



The Assume SS Equals DS options specify how the compiler interprets thestack segment. 


 

The Defines input box is where you enter macro definitions to thepreprocessor.  A header that contains code can't be pre-compiled. For example, although C++ class definitions can appear in header files, makesure that only inline member functions are defined in the header. Heed warnings such as "Functions containing 'for' are not expanded inline".



  -H Compiler Options

    Option   What It Does:


-H          Causes the compiler to generate and use precompiled headers


 -H-         (Default) Turns off the generation and use of

             precompiled headers


 -Hu         Tells the compiler to use (but not generate) precompiled headers

 -H=filename Turns on the generation and use of precompiled headers, and                   sets the name of the file for precompiled headers. The

                 default for "filename" is TCDEF.SYM.   


 #pragma hdrfile

Sets the name of the file where Turbo C++ will store pre-compiled 

headers.  Syntax:  #pragma hdrfile "filename.SYM"  Default = TCDEF.SYM


 If you aren't using precompiled headers, this directive has no effect. You use the command-line compiler option -H=filename to change the name ofthe file used to store precompiled headers.



  #pragma hdrstop 

Terminates the list of header files that are eligible for precompilation. You can use hdrstop to reduce the amount of disk space used by



Comments

Popular posts from this blog

CONNECTING WITH FTP-FILE TRANSFER PROTOCOL

PROBING THE INTERNET WITH TELNET: