How do I use my c/c++ libraries in D?

Don Clugston dac at nospam.com.au
Tue Dec 19 05:04:13 PST 2006


Stan Hebben wrote:
> I have a lot of questions about using my c/c++ libraries in d.
> - How does the compiler 'map' the c libraries to d modules? (ex. if I write
> 'import std.c.stdio', where does the compiler look for this file)
> - Does the D compiler use C header files, or header files which are converted
> to D?

Headers converted to D. The ctod program from the digital mars site will 
  do an automatic conversion for you. You also need the coffimplib 
program to convert the .lib files from Microsoft/COFF format into OMF 
format.

> I mainly want to use the Windows / DirectX API in D, as well as some other
> libraries.

Look on www.dsource.org in the 'bindings' project, several have already 
been converted.

> I suppose this question has been asked many times, but I couldn't find it on
> the forums. (neither did I find my answer somewhere else on the web)


More information about the Digitalmars-d-learn mailing list