- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes it is set to /iface:stdcall. I change to default and it works... Thank you!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page