undefined reference to `derf'

undefined reference to `derf'

I compile others' codes ,I find it have a function below, I compile .......

Double Precision Function myderf(a)
Implicit None
Double Precision a
Double Precision derf
External derf
myderf=derf(a)

Return

End Function myderf

I got errors

ze_i386.o: In function `myderf_':
ze_i386.f90:(.text+0x1b): undefined reference to `derf'
ze_i386.o: In function `myderfc_':
ze_i386.f90:(.text+0x3b): undefined reference to `derfc'

why ?  need  I  link something ?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

ERF, DERF and QERF are intrinsic functions, not external functions. Either change "External" to "Intrinsic" or comment out the statement altogether.

Similar remarks apply to ERFC.

I agree with mecej4.  external derf states that you will supply an implementation of derf and that you don't want to use the Fortran built-in (erf preferred).   Inclusion of erf in the Fortran intrinsic list is a relatively recent change, so you may still be able to find old compilers which prefer the way you have presented it (but you are then likely to need to link specifically against a library which provides derf).

Leave a Comment

Please sign in to add a comment. Not a member? Join today