extern intended behavior?

David Medlock noone at nowhere.com
Tue Jun 13 07:17:46 PDT 2006


Derek Parnell wrote:
> On Tue, 13 Jun 2006 23:44:26 +1000, David Medlock <noone at nowhere.com>  
> wrote:
> 
<snip>
>> Am I missing something?
> 
> 
> Yes. The way to do this is D is that you also create another file  
> 'test.di' that contains ...
> 
>  // test.di --------------------
>   void MyFunction();
> 
> And you modify main.d
> 
>  // main.d  ----------------------
>  import test;
>  void main(char[][] args )
>  {
>     MyFunction();
>  }
> 
> Then you compile them as ...
> 
>   dmd -c test
>   dmd main test.obj
> 

Thanks Derek.

It appears you can also just wrap them both with extern(C) and leave 
them in D files.

-DavidM



More information about the Digitalmars-d mailing list