Sign in Join
FPDoc Onlineexperiment

The resource directive $R

Under Windowsand Linux(or any platform using ELF binaries) 12, you can include resources in your executable or library using the {$R filename} directive. These resources can then be accessed through the standard WindowsAPI calls: these calls have been made available in the other platforms as well.

When the compiler encounters a resource directive, it just creates an entry in the unit .ppu file; it doesn’t link the resource. Only when it creates a library or executable, it looks for all the resource files for which it encountered a directive, and tries to link them in.

The default extension for resource files is .res. When the filename has as the first character an asterisk (*), the compiler will replace the asterisk with the name of the current unit, library or program.

Remark: This means that the asterisk may only be used after a unit, library or program clause.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.