extern(Windows) export in std.c.windows.windows

torhu no at spam.invalid
Sat Feb 16 11:53:44 PST 2008


Sergey Gromov wrote:
> torhu <no at spam.invalid> wrote:
>> It's needed when linking to variables that are in a DLL, though.  If you 
>> don't add it, even variable declarations with the 'extern' storage class 
>> will turn into definitions.
> 
> This explains it, thanks.  This also means that export is sometimes also 
> import because extern is not actually for an extern symbol but merely a 
> calling convention specifier.

This guide mostly explains it:
http://www.digitalmars.com/d/2.0/htomodule.html


And yes, 'export' is used for imports too.

Just 'extern' works like in C, while 'extern (XYZ)' is really an 
unrelated feature.


More information about the Digitalmars-d-learn mailing list