Export values (enum, int, char[]...) for DLL

torhu no at spam.invalid
Wed May 5 12:05:39 PDT 2010


On 04.05.2010 21:46, Nrgyzer wrote:
> Hello everybody,
>
> I'm trying to create a (very) simple DLL by using D. Now I want export values - is there any way do this...

Off the top of my head, I think it goes like this:

To export from a DLL:
export int i = 7;

To export from a DLL, with C name mangling:
export extern (C) int i = 7;


To import from a DLL:
export extern int i;

To import from a DLL with a C interface:
export extern extern (C) int i;


I'm not sure if I recall the export part correctly, it's been a while 
since I actuall tried this.


More information about the Digitalmars-d-learn mailing list