Show: Delphi C++
Display Preferences

Compiler directives for libraries or shared objects (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Delphi Compiler Directives (List) Index

Type

Parameter

Syntax

$LIBPREFIX 'string'
$LIBSUFFIX 'string'
$LIBVERSION 'string'

Defaults

$LIBPREFIX 'lib' or $SOPREFIX 'bpl'
$LIBSUFFIX ' '
$LIBVERSION ' '

Scope

Global



Remarks

The $LIBPREFIX, $LIBSUFFIX, and $LIBVERSION directives allow you to construct a uniquely named image while ensuring that the intermediate symbol file (the .dcp or .bpi) remains 'undecorated'. This means that you:

  • Need only reference the <base-name>.dcp (or simply <base-name> from the 'requires' clause of a dpk).
  • Can make changes to the output file versions without having to update all source references.

In the IDE, you can set these directives on the Project > Options > Description page.

$LIBPREFIX overrides the default 'lib' or 'bpl' prefix in the output file name. For example, for a design-time package, you could specify:

{$LIBPREFIX 'dcl'}

Or you could use the following directive to eliminate the prefix entirely:

{$LIBPREFIX ' '}

$LIBSUFFIX adds a specified suffix to the output file name before the extension. For example, use:

{$LIBSUFFIX '-2.1.3'}

in something.pas to generate:

something-2.1.3.dll

$LIBVERSION adds a second extension to the output file name after the extension. For example, use:

{$LIBVERSION '-2.1.3'}

in something.pas to generate:

libsomething.dll.2.1.3

See Also

Personal tools
In other languages