Link object file (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Delphi Compiler Directives (List) Index




{$L filename} {$LINK filename}




The $L parameter instructs the compiler to link the named file with the program or unit being compiled.

The $L directive is used to link with code written in other languages for procedures and functions declared to be external.

The format of the object file recognized by the Delphi compiler depends on the target platform.

For 32-bit Windows, the named file must be an Intel relocatable object file (OMF86), or 32-bit COFF format object file.

For 64-bit Windows, ELF objects generated by bcc64, and COFF objects by Visual C++, can be recognized.

The default extension for filename is .OBJ. If filename does not specify a directory path, then, in addition to searching for the file in the same directory as the current module, Delphi searches in the directories specified in the Search path input box on the Directories/Conditionals page of the Project|Options dialog box (or in the directories specified in the -O option on the command line).

To specify a file name that includes a space, surround the file name with single quotation marks: {$L 'My file'}.

For further details about linking with assembly language, see online Help.