Can't get D calling C to build.

torhu no at spam.invalid
Thu Aug 26 19:51:05 PDT 2010


On 23.08.2010 23:24, Bob Cowdery wrote:
> Addendum: The plot thickens. If I build a dll with my VC++ Express 2010
> then I can convert the import library and it actually works from D.
> However if I build with MinGW GCC it doesn't even recognise the library
> even though it is COFF format. My preferred route unfortunately is GCC.
> I just got 'The D Programming Language' book and that devotes a whole
> half page to this very important topic. This seems to be rather a
> minefield and so far there only seems to be one route through it.

If you've got a DLL, you can usually generate an import library directly 
from that using the implib tool, download link below.

ftp://ftp.digitalmars.com/bup.zip

This obviously fails for DLLs that only export by ordinal, but those are 
not that common.  You need to use the /s switch to get correct name 
mangling.


More information about the Digitalmars-d-learn mailing list