gdc error “Error: module file is in file 'file

2019-08-14 08:45发布

I have searched and have seen similar errors but nothing specific as to how to fix this error. Using gdc (D compiler) I get this error message on my crunchbang debian linux machine:

gdc main.d fasta.d utilities.d
utilities.d:3: Error: module file is in file 'file.d' which cannot be read
import path[0] = /usr/include/d2/4.6/x86_64-linux-gnu
import path[1] = /usr/include/d2/4.6
utilities.d:3: Error: module file is in file 'file.d' which cannot be read
import path[0] = /usr/include/d2/4.6/x86_64-linux-gnu
import path[1] = /usr/include/d2/4.6

This is after freshly installing gdc with apt-get install.

标签: d
2条回答
在下西门庆
2楼-- · 2019-08-14 08:59
  • If file.d is your own file: You can add an include path with -I/path/to/files. I am not entirely sure how GDC handles it, but if you also add file.d after utilities.d (if it is in the current directory) it should detect that module too.
  • If you want the standard file library: import std.file;
查看更多
贼婆χ
3楼-- · 2019-08-14 09:11

Whilst this may be of limited interest to the OP I've encountered the same behaviour in Mint. This is also a bug submitted in Launchpad, affecting raring. The recommended action, acompanying the bug-report is to install libphobos2-4*-dev, if its not present (please, notice the wildcard in the name -- there are two different libraries ).

The aformentioned action did nothing for my situation, even though Mint 15 is Raring-based...

查看更多
登录 后发表回答