【发布时间】:2015-12-02 00:38:45
【问题描述】:
我刚刚在一台新 PC 上安装了 Code Blocks 13.12,并尝试创建一个 Fortran DLL 项目。我使用 MinGW 获得了代码块,因此安装了 Fortran 编译器。 如果您创建一个新的 Fortran DLL 项目,代码如下所示
! A fortran95 lib program for G95
! By WQY
subroutine sub()
implicit none
write(*,*) "This is subroutine"
return
end
当您按原样构建时,您会收到以下错误:
||=== Build: Debug in FortranDLLTest (compiler: GNU GCC Compiler) ===|obj\Debug\main.o||In function `sub_':|
[...]\FortranDLLTest\main.f95|5|undefined reference to `_gfortran_st_write'|
[...]\FortranDLLTest\main.f95|5|undefined reference to `_gfortran_transfer_character_write'|
[...]\FortranDLLTest\main.f95|5|undefined reference to `_gfortran_st_write_done'|||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
这是我第一次尝试代码块,所以我没有任何线索。看起来有些东西没有链接,但新项目不应该直接编译吗?
【问题讨论】:
标签: dll fortran codeblocks