extern (D)?
Justin Whear
justin at economicmodeling.com
Thu Jan 17 17:07:05 PST 2013
On Fri, 18 Jan 2013 02:01:52 +0100, Rob T wrote:
> The usual way to link in D libs into D code is to include the required D
> module source files, but that gives away all of the source code which in
> some instances is not possible to do (eg legal reasons). The other way
> is to create a c-style API using extern (C), but that means translating
> some structures from D to C, and then from C back to D which is not a
> nice solution. As far as I know, there's no extern (D), but maybe there
> is something like it available. Anyone know?
>
> --rt
You can use "extern(D)" or simply "extern"; this is described here:
http://dlang.org/attribute.html#linkage
Justin
More information about the Digitalmars-d-learn
mailing list