D - C linking to D
- Mark Brudnak (4/4) Nov 30 2003 Anyone,
- Matthew Wilson (5/8) Nov 30 2003 I can't see any reason why not, so long as you are using C-compatible ty...
- Ilya Minkov (7/9) Dec 03 2003 It is necessary to initialise the D runtime (GC, etc.) from the C
Anyone, Can D build binaries which are linkable from C? In other words can I link a bottom level D module/library etc. to a top level C program? Mark.
Nov 30 2003
I can't see any reason why not, so long as you are using C-compatible types, i.e. ptrs not arrays, etc. "Mark Brudnak" <malibrud provide.net> wrote in message news:bqedce$2af0$1 digitaldaemon.com...Anyone, Can D build binaries which are linkable from C? In other words can I linkabottom level D module/library etc. to a top level C program?
Nov 30 2003
Matthew Wilson wrote:I can't see any reason why not, so long as you are using C-compatible types, i.e. ptrs not arrays, etc.It is necessary to initialise the D runtime (GC, etc.) from the C environment. Then it is necessary to use extern(C) convention in D. Then write headers. Gets more cumbersome than not. For more information on initialising and shutting down the runtime, see manual chapter on using WinMain entry point in D... -eye
Dec 03 2003