我正在用Fortran90编写一个模块,主要是在模块内部定义了一个函数,以及一个使用该函数的子程序。这是模块的摘录
module Mesh_io
implicit none
private
contains
integer function findkey ( )
content of this function
end function
subroutine getNumber_Mesh ()
integer :: findkey
content of the routine
end subroutine getNumber_Mesh
end module
Run Code Online (Sandbox Code Playgroud)
编译时我得到以下输出:
objects/Main.o: In function `__mesh_io_MOD_getnumber_mesh':
Main.f90:(.text+0x9e): undefined reference to `findkey_'
Run Code Online (Sandbox Code Playgroud)
如您所见,该函数包含在模块中,但由于某种原因编译器找不到它。