| 
 
	积分49贡献 精华在线时间 小时注册时间2013-5-26最后登录1970-1-1 
 | 
 
| 
三个文件,
x
登录后查看更多精彩内容~您需要 登录 才可以下载或查看,没有帐号?立即注册 
  add.f90
 module MA
 implicit none
 contains
 subroutine show_int(n)
 implicit none
 integer , intent(in) ::n
 write(*,"('n=',I3)") n
 return
 end subroutine show_int
 subroutine show_character(str)
 implicit none
 character(len=*) ,intent(in) :: str
 write(*,"('str=',A)") str
 return
 end subroutine show_character
 end module
 
 second: add.h
 interface show
 module procedure show_int, show_character
 end interface
 
 third:main.f90
 program main
 use MA
 implicit none
 include 'add.h'
 call show_int(1)
 call show(1)
 call show_character("Fortran 95")
 call show("Fortran 95")
 print * ,"hello "
 end program
 编译gfortran add.f90 main.f90 -o main
 得到错误。。。
 add.h:2.2: 包含于 main.f90:4:
 module procedure show_int, show_character
 1
 错误: (1) 语句无法归类
 main.f90:6.13:
 call show(1)
 1
 错误: 泛型‘show’在(1)处没有特定的子进程
 main.f90:8.24:
 call show("Fortran 95") 1
 错误: 泛型‘show’在(1)处没有特定的子进程
 I don't know why ? can you help me ? Thanks
 
 
 | 
 |