gdc错误“错误:模块文件位于文件'file.d'中,无法读取”。 [英] gdc error "Error: module file is in file 'file.d' which cannot be read"

查看:176
本文介绍了gdc错误“错误:模块文件位于文件'file.d'中,无法读取”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索并看到了类似的错误,但是对于如何解决此错误没有具体说明。使用gdc(D编译器)时,在我的crunchbang debian linux机器上收到以下错误消息:

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

这是在使用apt-get install新安装gdc之后。

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

推荐答案


  • 如果 file.d 是您自己的文件:您可以使用 -I / path添加包含路径。 / to / files 。我不确定GDC如何处理它,但是如果您还在 utilities.d 之后添加 file.d (如果

  • 如果要使用标准文件库,请执行以下操作: import std.file;

    • 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;
    • 这篇关于gdc错误“错误:模块文件位于文件'file.d'中,无法读取”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆