Search code examples
d

module `testavg` is in file 'testavg.d' which cannot be read d


Every-time, I try to run a program it gives me an error similar to this. I haven't done anything other than download it. I tried to reinstall it and got the same results. It is on a windows 10 computer.

enter image description here

Error: module `testavg` is in file 'testavg.d' which cannot be read
import path[0] = C:\D\dmd2\windows\bin\..\..\src\phobos
import path[1] = C:\D\dmd2\windows\bin\..\..\src\druntime\import

https://dlang.org/download.html


Solution

  • This means that the D compiler can't find the source file testavg.d. Either change directory to where the file is and run the same command, or give a full path to the source file: dmd C:/my/d/source/files/testavg.d (replace the path to the testavg.d with the actual path)