July 28, 2020 D import stmt doesn`t seem to ' import' | ||||
---|---|---|---|---|
| ||||
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 Re: D import stmt doesn`t seem to ' import' | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andy Balba | 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.
|
Copyright © 1999-2021 by the D Language Foundation