Passing directory as compiler argument not finding file

Nicholas Wilson iamthewilsonator at hotmail.com
Thu Apr 12 06:22:30 UTC 2018


On Thursday, 12 April 2018 at 05:39:21 UTC, Jamie wrote:
> With a directory structure as follows:
>
>     run/
>     A/
>         a.d
>
> Where a.d is:
>     ===========
>     module A.d;
>
>
> I'm attempting to compile from the run/ directory. If I run with
>     dmd ../A/a.d
>
> it compiles successfully, however if I pass it the directory
>     dmd -I=../A a.d
>
> it doesn't compile. Also, if I pass the exact directory
>     dmd -I=/../A a.d
>
> it doesn't compile.
>
> Both times I get the error
> Error: module `a` is in the file 'a.d' which cannot be read
>
> However it then shows the import path as being
> import path[0] = ../A
>
> for the first way and
> import path[0] = /../A
> for the second way.
>
> Am I using the -I compiler option incorrectly?

is it thinking /../A is an absolute path?
try -I=./../A


More information about the Digitalmars-d-learn mailing list