Want a module to import from a sister directork; How?

jwatson-CO-edu real.name at colorado.edu
Tue Feb 14 17:53:34 UTC 2023


I have the following directory structure:
```
ANN/
     ANN/mathkit/
         ANN/mathkit/package.d
     ANN/utils/
         ANN/utils/package.d
     ANN/MLP.d
```

I have the following in "ANN/mathkit/package.d":

```d
module ANN.mathkit;
//...
/// Local Imports ///
import ANN.utils;
//...
```

I have the following in "ANN/MLP.d":

```d
import mathkit;
//...
void main(){ /* ... */ }
```

When I
`rdmd MLP.d`

I get the following error:
```
mathkit/package.d(7): Error: unable to read module `utils`
mathkit/package.d(7):        Expected 'ANN/utils.d' or 
'ANN/utils/package.d' in one of the following import paths: // ...
```

How do I build my project with these dependencies?:
```
utils --> mathkit --> MLP
     \                 ,^
      `---------------'
```

Must I choose a different structure?
Should I be using DUB?


More information about the Digitalmars-d-learn mailing list