다음을 통해 공유


/EXPORT (Windows CE 5.0)

Send Feedback

This option allows you to export a function from your program so that other programs can call the function. You can also export data. Exports are usually defined in a DLL.

/EXPORT:entryname[=internalname][,@ordinal[,NONAME]][,DATA]

Remarks

Note   You can only use this linker option for a small number of exports. It is recommended that you use the EXPORTS statement in a .def file instead.

The entryname is the name of the function or data item as it is to be used by the calling program. You can optionally specify the internalname as the function known in the defining program; by default, internalname is the same as entryname.

The ordinal specifies an index into the exports table in the range 1 through 65,535; if you do not specify ordinal, LINK assigns one. The NONAME keyword exports the function only as an ordinal, without an entryname.

The DATA keyword specifies that the exported item is a data item. The data item in the client program must be declared using extern __declspec(dllimport).

There are three methods for exporting a definition, listed in recommended order of use:

  • The __declspec(dllexport) keyword in the source code
  • An EXPORTS statement in a .def file
  • An /EXPORT specification in a LINK command

All three methods can be used in the same program. When LINK builds a program that contains exports, it also creates an import library, unless an .exp file is used in the build.

LINK uses decorated forms of identifiers. The compiler decorates an identifier when it creates the .obj file.

If entryname or internalname is specified to the linker in its undecorated form (as it appears in the source code), LINK attempts to match the name. If it cannot find a unique match, LINK issues an error message.

Use the DUMPBIN_ tool to get the decorated Names form of an identifier when you need to specify it to the linker.

Note   Do not specify the decorated form of C identifiers that are declared __cdecl or __stdcall.

See Also

Linker Options

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.