Package Compiler Directives

There are some specific compiler directives that you can insert into the source code of your packages. Some of these directives are specific to units that are being packaged; others are specific to the package file. These directives are listed and described in Tables 14.3 and 14.4.

Table 14.3. Compiler Directives for Units Being Packaged
Directive Meaning
{$G} or {IMPORTEDDATA OFF} Use this when you want to prevent the unit from being packaged—when you want it to be linked directly to the application. Contrast this to the {$WEAKPACKAGEUNIT} directive, which allows a unit to be included in a package but whose code gets statically linked to the application.
{$DENYPACKAGEUNIT} Same as {$G}.
{$WEAKPACKAGEUNIT} See the

Get Borland® Delphi™ 6 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.