ATTRIBUTES DLLEXPORT and DLLIMPORT

The ATTRIBUTES directive options DLLEXPORT and DLLIMPORT define a dynamic-link library's interface for processes that use them. The options can be assigned to module variables, COMMON blocks, and procedures. These directive options are available on Windows* and Mac OS* X systems. They take the following forms:

Syntax

cDEC$ ATTRIBUTES DLLEXPORT :: object[, object] ...

cDEC$ ATTRIBUTES DLLIMPORT :: object[, object] ...

c

Is one of the following: C (or c), !, or *. (See Syntax Rules for Compiler Directives.)

object

Is the name of a module variable, COMMON block, or procedure. The name of a COMMON block must be enclosed in slashes.

DLLEXPORT and DLLIMPORT define the interface for the following dynamic-link libraries:

DLLEXPORT specifies that procedures or data are being exported to other applications or dynamic libraries. This causes the compiler to produce efficient code; for example, eliminating the need on Windows OS for a module definition (.def) file to export symbols.

DLLEXPORT should be specified in the routine to which it applies.

Symbols defined in a DLL are imported by programs that use them. On Windows* OS, the program must link with the DLL import library (.lib).

The DLLIMPORT option is used inside the program unit that imports the symbol. DLLIMPORT is specified in a declaration, not a definition, since you cannot define a symbol you are importing.

See Also


Submit feedback on this help topic
Related information
ATTRIBUTES

Copyright © 1996-2010, Intel Corporation. All rights reserved.