As previously mentioned, and unlike Unix systems, the list of symbols
that are exported from a DLL must be provided explicitly in Windows.
The main goal of a definition file is precisely that: list the symbols
exported by a DLL. A definition file (usually a file with a .def
suffix) has the following structure:
[LIBRARY name] [DESCRIPTION string] EXPORTS symbol1 symbol2 ... |
LIBRARY
nameDESCRIPTION
stringEXPORTS
EXPORTS
section of API.def looks like:
EXPORTS some_var get |
Note that you must specify the correct suffix (@
nn)
(see Windows Calling Conventions) for a Stdcall
calling convention function in the exported symbols list.
There can actually be other sections in a definition file, but these sections are not relevant to the discussion at hand.