Incorporating D

q66 quaker66 at gmail.com
Fri Jan 25 13:09:00 PST 2013


On Friday, 25 January 2013 at 21:07:00 UTC, q66 wrote:
>>> 2) Is there a way to start adding D code to a C++ projects?
>>
>> Yes. You'll need to expose parts of the D code as extern(C) or 
>> extern(C++) to interface with it, and remember to initialize 
>> the D  runtime.
>>
>
> As he apparently is on Windows, you can only do this with a D 
> DLL, which are likely to be a PITA (but at least they should 
> work unlike on un*x); you can't really link D object files and 
> C/C++ object files together, as on win32 OMF is used (you could 
> use unilink, but that's so obscure I wouldn't expect a newbie 
> to mess with this at all). So I'd take this as "no"

you could theoretically use dmc/dmc++ to compile the rest, but 
that just asks for problems; you could also use GDC, which 
basically assumes MinGW as the C++ toolchain (though it might 
work with other compilers if done as a DLL) .. LLVM on Windows is 
still rather immature so LDC is not an option (SEH and so on)


More information about the Digitalmars-d mailing list