On Saturday, 14 September 2013 at 16:46:06 UTC, Buk wrote:
Hi all,

I've read http://dlang.org/dll.html, and frankly there seems to be a lot of boilerplate & rote process to build a DLL.

I realise that many of the do nothing functions /can/ be used to do a lot more; and these may be required for some purposes. But, for a simple DLL of functions, that can be built in C as simply as:

C:\test\demo>type mydll.c
int __declspec(dllexport) add( int a, int b ) {
    return a + b;
}

C:\test\demo>cl /MT /LD mydll.c
mydll.c
/out:mydll.dll
/dll
/implib:mydll.lib
mydll.obj
   Creating library mydll.lib and object mydll.exp

C:\test\demo>dumpbin /exports mydll.dll
Dump of file mydll.dll
File Type: DLL
  Section contains the following exports for mydll.dll
           1 ordinal base
           1 number of functions
           1 number of names

    ordinal hint RVA      name

          1    0 00001000 add

Is there any similar mechanism for these 'simple' cases for D?

If not, shouldn't it be possible to create an ?interface? file that takes care of the boilerplate? (If so, does anyone have one they can share?)

Thanks, Buk.

Thanks for the help guys.

Reply via email to