Keyword "package" prevents from importing a package module "package.d"

Paul Backus snarwin at gmail.com
Thu Nov 2 12:10:07 UTC 2023


On Thursday, 2 November 2023 at 11:12:58 UTC, BoQsc wrote:
> Weirdly enough it does not work on Windows operating system.
> [...]
> ```
> program.d(1): Error: unable to read module `waffles`
> program.d(1):        Expected 'waffles.d' or 
> 'waffles\package.d' in one of the following import paths:
> import path[0] = .
> import path[1] = C:\D\dmd2\windows\bin\..\..\src\phobos
> import path[2] = C:\D\dmd2\windows\bin\..\..\src\druntime\import
> Failed: ["C:\\D\\dmd2\\windows\\bin\\dmd.exe", "-v", "-o-", 
> "program.d", "-I."]
>
> C:\waffles>dmd -i -run program.d
> program.d(1): Error: unable to read module `waffles`
> program.d(1):        Expected 'waffles.d' or 
> 'waffles\package.d' in one of the following import paths:
> import path[0] = C:\D\dmd2\windows\bin64\..\..\src\phobos
> import path[1] = 
> C:\D\dmd2\windows\bin64\..\..\src\druntime\import
>
> ```

The problem is the directory you're running the command from. You 
need to run `dmd` from the parent directory of `waffles`.


More information about the Digitalmars-d-learn mailing list