C++ Header File (*.h, *.hpp) - RAD Studio - Embarcadero DocWiki

Go Up to File Types Index

C++ header files define a C++ interface, usually implemented in a C++ implementation file.

C++Builder Header Files

In C++Builder:

  • Units usually contain a C++ header file with <unit name>.h as file name.
  • Projects contain a C++ header file, <project name>PCH<n>.h.

C++ Header Files of Delphi Packages

When you build Delphi packages, RAD Studio generates a C++ header file for each unit in your package (<unit name>.hpp), as well as a C++ header file for your package as a whole (<package name>.hpp), as long as the C/C++ Output file generation option in Project > Options > Delphi Compiler > Output - C/C++ is "Generate all C++Builder files (including package libs)".

C++ projects that use your package need these C++ header files for compiling.

When you build your Delphi package, your C++ header files are generated by default into the following folder:

  • For desktop platforms: C:\Users\Public\Documents\Embarcadero\Studio\21.0\hpp\<platform>
  • For mobile platforms: C:\Users\<user>\Documents\Embarcadero\Studio\Projects\<project>\<platform>\<build configuration>

To change the output directory, use the C/C++ .hpp output directory option in Project > Options > Delphi Compiler > Output - C/C++.

See Also

  • C++ Precompiled Header File (*.pch)
  • C++ Implementation File (*.cpp)
  • Package Files Created by Compiling

Từ khóa » .h .hpp