Calling D from C - What's the present status?

hauptmech th_sx at mailsnare.net
Fri Jan 19 01:37:51 PST 2007


I'd like to maintain an internal (to my company) code library in D
but provide customers with a libxxx.a and *.h files so they can use C.

I'd like to provide access to classes and members. My C library code
is more or less object oriented (ei pass in a pointer to data as the
first arg to a "member" function) so customers can deal with that.

I read the short snippet that said functions attributed as extern(C)
can be called... and I vaguely rememeber experimenting a year ago and
being able to call class members with a little pointer abuse...

Is there a compiler switch that will generate a nice *.h file?!?

Or perhapse more reasonably; does anyone know of any projects out
there geared towards providing C bindings for D libraries in an
automated way?

hauptmech







More information about the Digitalmars-d-learn mailing list