CodeBlocks+Gfortran在Windows上的配置与运行

先安装Gfortran,再装CB,选择GNU Fortran编译器,

Codeblocks13.12搭载Fortran开发环境,设置compiler

step 1.settings——〉compiler——〉Selected compiler选择GNU Fortran Compiler ——〉Set as default

step 2. settings——〉compiler——〉Toolchain excutables:

                C compiler:     mingw32-gfortran.exe

                C++ compiler:   mingw32-gfortran.exe

                Linker for dynamic libs:  mingw32-gfortran.exe

                Linker for static libs:  ar.exe

                Debugger :     GDB/CDB debugger:Default

                Resource compiler: windres.exe

                Make program: mingw32-make.exe

注意,最后黑体的一定要设置好,因为完成step 1后step 2中前6项是自动设置,而是make program: make.exe。如果不改为Make program: mingw32-make.exe则会出现如下例子中的编译问题:

编译信息:

D:\fortran_programming\gauss\main.f95:19.16:

end module gauss

             1

Fatal Error:can’t open module file'D:\fortran_programming\gauss\main.os_output_dir/gauss.mod0' for writing at (1): No such file or directory

Process terminated with status 1 (0 minute(s), 0 second(s))

1 error(s), 0 warning(s) (0 minute(s), 0 second(s))


最后新建一个project,修改f90文件即可

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。