linking to C libraries
Robert Fraser
fraserofthenight at gmail.com
Wed Dec 5 13:27:07 PST 2007
aeschere wrote:
> I am trying to use D in more of my everyday programming (utility
> programming at the moment). However, quite often I need to link to
> various C libraries (for example pcap). Does D support linking to C
> libraries? If it does, are there special concerns that I need to be
> aware of?
>
> Thank you in advance for your time,
>
> Michael
Yes, that's one of the main features of D :-)!
Check out the docs for it: http://www.digitalmars.com/d/interfaceToC.html
I'd recommend taking the C header files and running them through a
program that will automatically translate them to D modules:
http://www.digitalmars.com/d/htod.html
That page explains some of the syntactic differences and how to get it
all going smoothly.
More information about the Digitalmars-d-learn
mailing list