本帖最后由 sohu 于 2016-4-22 13:21 编辑
自己练习的小程序,为啥会出现如题所示错误
[Fortran] 纯文本查看 复制代码 program main
real*8::x=8.0
real*8::y
y=add(1,x)
write(*,*)y
stop
end
real*8 function add(I,x)
implicit real*8(a-h,o-z)
implicit integer(i-k,l,m-n)
if(I==1) add=x+10.0
return
end
错误信息:
y=add(1,x)
1
Error: Return type mismatch of function 'add' at (1) (REAL(4)/REAL(8))
Error(E42): Last command making (build\test2.o) returned a bad status
Error(E02): Make execution terminated
* Failed *
|