Translating C headers to D: How do I compile it?

Kirill kirill.saidov at mail.com
Sun Jun 28 11:49:09 UTC 2020


On Sunday, 28 June 2020 at 05:13:32 UTC, Mike Parker wrote:
> On Sunday, 28 June 2020 at 04:59:12 UTC, Kirill wrote:
>>
>> something.d:
>> module something;
>> int add(int a, int b);
>
> This should be extern(C) int add(int a, int b). The extern(C) 
> tells the D compiler to use the standard C calling convention 
> when calling that function.
>

Thanks! It all works now! 'extern(C)' is what was missing.


More information about the Digitalmars-d-learn mailing list