July 28, 2020
if file hh.d  contains :
  int hh_t ( int x)
  { writeln ("hhh x= ", x );
  }

and file test.d (in same dir as file hh.d ) contains :

import std.stdio ;
import hh ;
void main()
{  hh_t(3);
}

Why does compiling test.d generate an "undefined ref"   ?

July 28, 2020
On Tuesday, 28 July 2020 at 05:45:03 UTC, Andy Balba wrote:
> if file hh.d  contains :
>   int hh_t ( int x)
>   { writeln ("hhh x= ", x );
>   }
>
> and file test.d (in same dir as file hh.d ) contains :
>
> import std.stdio ;
> import hh ;
> void main()
> {  hh_t(3);
> }
>
> Why does compiling test.d generate an "undefined ref"   ?

dmd test.d hh.d or dmd -i test.d. import is purely at the language level, it doesn't affect the linker.