Global compiler directives

Free Pascal supports compiler directives in the source file. Basically the same directives as in Turbo Pascal, Delphi and Apple Pascal (Mac OS) pascal compilers are supported. Some are recognized for compatibility only, and have no effect.

Syntax

edit

General:

Specific:

Code generation

edit

Data inclusion

edit

Paths

edit

Target-dependent

edit

Novell NetWare only

edit

Palm OS and Garnet OS only

edit
  • {$appID} defines four-character application identifier
  • {$appName} determines the name of the application

Windows-based systems

edit
  • {$imageBase} specifies DLL image base location
  • {$minStackSize}
  • {$maxStackSize}
  • {$setPEFlags}
  • {$version} defines version number of a DLL

Miscellaneous

edit

Compile-time data

edit

Ignored

edit
  • {$description}: introduced for compatibility and as of FPC 3.0.4 ignored
  • {$G} would generate 80286 code with TP
  • {$localSymbols} or {$L}
  • {$N} (numeric processing)
  • {$O} enabled level 2 optimizations. It is not recognized anymore since FPC 2.0.0. Use {$optimization} instead.
  • {$weakPackageUnit}

See also

edit
Directives, definitions and conditionals definitions
global compiler directives • local compiler directives Conditional Compiler Options • Conditional compilation • Macros and Conditionals • Platform defines $IF