C/C++ Compiler (cl.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Using Precompiled Headers in PWB
                                             Up Contents Index Back
─────Programmer's WorkBench─────────────────────────────────────────────────
 
     You can take advantage of precompiled headers with a PWB project
     makefile by following the procedures and guidelines described in
     this Help.
 
     You must follow a certain procedure to create a PWB project that
     uses precompiled headers.
     See: Creating a Project with Precompiled Headers
 
     The use of precompiled headers in a PWB project makefile is subject
     to the following restrictions:
 
       ■  There is one precompiled header (.PCH) file for each source
          language in the project (C and/or C++).
 
          All files for a given language must use the same precompiled
          header. Each source file must include the same set of include
          files, in the same order, up to the include file that you
          specify in the Include File box in the Additional Global
          Options dialog box. The include file must be specified in
          each source file with the same path.
 
          You can use one .PCH file for all C files and one for all C++
          files. For a mixed C and C++ project, you must enable the use
          of precompiled headers for each language individually.
 
       ■  The precompiled header is based on the first source file.
 
          To build .PCH file, PWB uses the first source file in the
          project file list as the basis. The resulting .PCH file has
          the same base name as the terminating include file. You can
          specify which file is the first file in the list by choosing
          the To Top of List button in the Edit Project dialog box.
 
          TIP: A good way to control when the .PCH file is built is to
               use a stub source file as the basis for the precompiled
               header. The stub file contains only the common #include
               directives. Each file in the project should begin with
               the same list of include files, in the same order.
 
       ■  Do not use the /Fp option in the compiler options.
 
       ■  Do not use #pragma hdrstop in any source file.
 
     If your project cannot accomodate these restrictions, you can use a
     non-PWB project makefile. A non-PWB project makefile can be any
     NMAKE makefile. It has no restrictions on the use of precompiled
     headers. However, the Language Options commands are not available.
     See: Using Non-PWB Project Makefiles
 
     See
 
     Using Precompiled Headers with CL
                                    -♦-