Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
2 Views

error LNK2019: Unresolved external symbol DZREAL

Hello everyone, I am trying to compute the zero of a function using DZREAL(...) from the IMSL library with Fortran77. Unfortunately it gives me:

"error LNK2019: unresolved external symbol _DZREAL referenced in function _ELECTROCHEMICAL"

"fatal error LNK1120: 1 unresolved externals"
 

Here is a piece of my code:

SUBROUTINE ELECTROCHEMICAL (...)

USE ZREAL_INT
IMPLICIT REAL*4 (A-H,J-Z)


INTEGER ITMAX,NROOT
REAL*8 EPS,ERRABS,ERRREL,ETA
PARAMETER (NROOT=1)
INTEGER INFO(NROOT)
REAL*8 F,XGUESS(NROOT),X(NROOT)

EXTERNAL F

 

CALL DZREAL(F,ERRABS,ERRREL,EPS,ETA,NROOT,ITMAX,XGUESS,X,INFO)

END SUBROUTINE ELECTROCHEMICAL

 

FUNCTION F(X)

REAL*8 F,X

...

RETURN

END FUNCTION F

Anyone is able to explain me why things do not work?

0 Kudos
1 Reply
Highlighted
Black Belt
2 Views

When you USE ZREAL_INT you

When you USE ZREAL_INT you are using the "F90 interface", which has you call ZREAL and the argument list may be different. See https://docs.roguewave.com/imsl/fortran/6.0/math/default.htm?turl=zreal.htm Your argument list is for the "F77 interface".

That said, the USE probably has no effect here since that module doesn't define DZREAL. Instead you have probably not linked to the IMSL libraries with the appropriate INCLUDE line in your main program.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos