Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26744 Discussions

error LNK2019: Unresolved external symbol DZREAL

Cammarata__Alberto
125 Views

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
Steve_Lionel
Black Belt Retired Employee
125 Views

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.

Reply