Passing directory as compiler argument not finding file

Jamie nothanks at gmail.com
Thu Apr 12 05:39:21 UTC 2018


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?


More information about the Digitalmars-d-learn mailing list