GDC Compilation wtih Directory Present

Murloc justanotheraccount3212334 at proton.me
Fri Jun 16 06:38:17 UTC 2023


On Friday, 16 June 2023 at 06:32:21 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> On 16/06/2023 6:26 PM, Murloc wrote:
>> Don't you need to provide a full path to these files 
>> relatively to the directory where the compilation process 
>> takes place (Test)?
>
> Yes.
>
> But I suspect you have not written the module statement, which 
> is required.
>
> ```d
> module pack.file1;
>
> // file1.d
> void printlnValueInFile2() {
>      import std.stdio: writeln;
>      import pack.file2: value;
>
>      writeln(value);
> }
> ```
>
> ```d
> module pack.file2;
>
> package(pack) int value = -120;
> ```
>
> Its also a good habit to write the package attribute with 
> explicit package(s).

Thanks! That works well. I thought that `module pack.file1` is 
implicitly there by default :')


More information about the Digitalmars-d-learn mailing list