Delphi Error – E2240 $EXTERNALSYM and $NODEFINE not allowed for ‘%s’; only global symbols

Delphi Compiler Error

E2240 $EXTERNALSYM and $NODEFINE not allowed for ‘%s’; only global symbols

Reason for the Error & Solution

The $EXTERNALSYM and $NODEFINE directives can only be applied to global symbols.