$ExternalSym Compiler Directive
The
$ExternalSym
compiler directive tells C++ Builder that
Identifier
is an external symbol that
should not be defined in the C++ header file
(.hpp) it generates for the Pascal unit.
Sometimes a symbol you must define in the Pascal unit is already
defined elsewhere in C++ Builder. Use the
$ExternalSym
compiler directive to prevent C++
Builder from writing the symbol in the .hpp
file. Note that the compiler uses the unit name as a namespace name.
When you use $ExternalSym
, you are telling the
compiler that the symbol is defined outside the namespace. Contrast
this behavior with the $NoDefine
directive, where
the symbol is defined in the unit’s namespace.