Show: Delphi C++
Display Preferences

CPP64, the Preprocessor for 64-bit Windows

From RAD Studio
Jump to: navigation, search

Go Up to Command-Line Utilities Index

CPP64.EXE is not related to its 32-bit Windows counterpart, CPP32.EXE, and CPP64 does not support the command line options supported by CPP32. However, CCPP64 does support the same preprocessor directives supported by CPP32.

Running CPP64.EXE is equivalent to running BCC64.EXE with the -E option ("Only run the preprocessor"). CPP64.EXE produces a file that lists a C or C++ program, in which all #include files and #define macros have been expanded. While you do not need to use the preprocessor during normal compilation, you may find the list file helpful for debugging purposes.

Often, when a compiler reports an error inside a macro or an include file, you can get more information about the error if you can see the include files or the results of the macro expansions. In many multipass compilers, the results of the preprocessing phase are preserved and can be examined. Because both BCC32 and BCC64 compilers are single-pass compilers, you need to use CPP64 if you want to obtain the preprocessing output.

Output File

For each file processed by CPP64, the output is written to a file in the current directory with the same name as the source name but with an extension of .i:

MyApp.i

This output file is a text file containing each line of the source file and any include files. Any preprocessing directive lines have been removed, along with any conditional text lines excluded from the compile. Within a text line, any macros are replaced with their expansion text.

Command-Line Syntax

CPP64 <filename[s]>

<filename> defines the file to be processed. Several files can be specified. At least one file should be specified.

Example

Having the following files:

  • pch.h:
  #include <P:\Test CPP64\File2.h>
  #include <P:\Test CPP64\File1.h>
  • File1.h
  int File1Func1(double, double);
  double File1Func2(int, int);
  • File2.h
  void File2Func1(int x, int y);
  void File2Func2(int, double);

This is the command that has been executed:

CPP64 preprocesor.png

This is the output file, pch.i:

#line 1 "pch.h"
#line 1 "pch.h"
#line 1 "<built-in>"
#line 1 "<built-in>"
#line 147 "<built-in>"
#line 1 "<command line>"
#line 1 "<built-in>"
#line 1 "pch.h"
#line 1 "P:\\Test CPP64\\File1.h"
int File1Func1(double, double);
double File1Func2(int, int);
#line 1 "pch.h"
 
#line 1 "P:\\Test CPP64\\File2.h"
void File2Func1(int x, int y);
void File2Func2(int, double);
#line 2 "pch.h"

See Also

Personal tools
In other languages
Previous Versions
Assistance