Windows系统,Codeblocks IDE,配置MinGW中GNU Fortran编译器,一个主程序和两个module模块程序,编译过程没有错误。
链接时不能识别编译器自己生成的.mod文件,出现F:\my_code\PSD_cal\obj\Debug\knl.mod: file not recognized: file format not recognized;collect2.exe: error: ld returned 1 exit status。
自查GFortran版本没有问题,knl.mod文件存在,且路径没有问题,但是电脑默认打开方式为“电影和电视”。尝试将.mod默认打开方式改成过GFortran的编译器x86_64-w64-mingw32-gfortran.exe,没用。求各位大佬指点T_T
mod没必要打开看。你删除整个debug文件夹,重新编译试试。如果还有问题,可以看看视频 https://www.bilibili.com/video/BV1oh411o7AT?p=1