Error 1 error LNK2019: unresolved external symbol

Error 1 error LNK2019: unresolved external symbol

I'm new in using Fortran.

I am creating a .dll from the following code:

testa.f

      SUBROUTINE TESTA(ID)
      !DEC$ ATTRIBUTES DLLEXPORT :: TEST
      IMPLICIT NONE
 
      INCLUDE 'params.f'

      DOUBLE PRECISION SVAL,VAL(2*MAXYBOUN)
      INTEGER ID,N(2),NOD(2*MAXYBOUN)
      CHARACTER*1 TYP(2)
      
      CALL DIRIC(ID,N,NOD,SVAL,VAL,TYP)
      
      !--------OTHER CODES-------!
      
      END

and the called function diric is 

      SUBROUTINE DIRIC(ID,N,NOD,SVAL,VAL,TYP)
      
      IMPLICIT NONE
 
      INCLUDE 'params.f'

      DOUBLE PRECISION SVAL,VAL(2*MAXYBOUN)
      INTEGER N(2),NOD(2*MAXYBOUN),K,J,NEQ,ID
      CHARACTER*1 TYP(2)

      !------------------------------------------------------------------!
      !     DIRIC code                                                     :
      !------------------------------------------------------------------!
      RETURN
      END   ! DIRIC

I get the LNK2019 error:

error LNK2019: unresolved external symbol _diric@32 referenced in function _testa   

The error disappears if I remove the character array TYP in subroutine, i.e.

CALL DIRIC(ID,N,NOD,SVAL,VAL)

SUBROUTINE DIRIC(ID,N,NOD,SVAL,VAL)

but I need the array TYP.

Is there any suggestion how to solve this problem? Thanks!

 

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

You must be compiling this code with some non-default options.Maybe you're using /iface:stdcall? Try /iface:stdref instead since the routine you're calling was apparently built that way.

Steve - Intel Developer Support

Yes it is set to /iface:stdcall. I change to default and it works... Thank you!

Leave a Comment

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