Fortran Coder

标题: Can't open module file 'func.mod' [打印本页]

作者: LightFifty007    时间: 2019-12-16 13:23
标题: Can't open module file 'func.mod'
大佬们好,新人求助!
操作系统:Ubuntu
编译器:   gfortran
错误提示:Can't open module file 'func.mod' for reading at (1): No such file or directory compilation terminated.

作者: 胡文刚    时间: 2019-12-16 17:20
找不到 module func,请找到它并编译它。然后就正常了。
作者: LightFifty007    时间: 2019-12-20 18:30
胡文刚 发表于 2019-12-16 17:20
找不到 module func,请找到它并编译它。然后就正常了。

明白了,谢谢
作者: FreemanArthur    时间: 2020-7-5 11:42
本帖最后由 FreemanArthur 于 2020-7-5 11:45 编辑

接楼,留个笔记
obj 文件是目标代码。

mod 文件是由 module 模块生成的,用来让编译器互相了解其他 module 的内容(接口,公有变量等)

obj 用来链接成最终的程序(exe或dll等)

而 mod 用来让编译器在编译其他代码时,获得该module的信息。不参与链接。



转自:https://zhidao.baidu.com/question/556760883.html




欢迎光临 Fortran Coder (http://bbs.fcode.cn/) Powered by Discuz! X3.2