Name
$ExternalSym Compiler Directive
Syntax
{$ExternalSym Identifier}Scope
Local
Description
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.
Example
type
size_t = LongWord;
{ExternalSym size_t} {C++ already defines this type}
var
S: size_t;See Also
| $HppEmit Compiler Directive, $NoDefine Compiler Directive, $NoInclude Compiler Directive |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access