[Fortran] 纯文本查看 复制代码 !MAIN PROGRAM
PROGRAM HOMEWORK0
complex*8 a,b
a=cdsqrt((-4.d0,0.d0))
write(*,*)a
b = cdabs(a)
write(*,*)b
stop
END PROGRAM HOMEWORK0
此程序编译有警告“D:\hw1.f(9) : Warning: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [A]”
链接出错“hw1.obj : error LNK2001: unresolved external symbol _CDABS@4”
*********************************************************************
而换这样写就没问题
[Fortran] 纯文本查看 复制代码 !MAIN PROGRAM
PROGRAM HOMEWORK0
complex*8 a,b
a=cdabs(cdsqrt((-4.d0,0.d0)))
write(*,*)a
stop
END PROGRAM HOMEWORK0
********************************************************************
请问这是什么问题?能介绍一下fortran是如何编译链接的。
|