- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It needs to be called from both Fortran and VB6.
So far, so good.
I am now attempting to call one of the subroutines (EPILOG)from another subroutine in the DLL (CALC_ATMOS).
When I try to build the DLL I get the following link error:
error LNK2019: unresolved external symbol __imp__EPILOG referenced in function Calc_Atmos.
Can anyone see what I have done wrong?
I have attached both Calc_Atmos.F90 and Epilog.F90.
Thanks,
Mark.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
INTERFACE
SUBROUTINE EPILOG(EXIT_CODE)
!DEC$ ATTRIBUTES STDCALL, REFERENCE, ALIAS:'Epilog' :: Epilog
INTEGER EXIT_CODE
END SUBROUTINE
END INTERFACE
to the calling subroutine or, better, put it into a module (with all your other
INTERFACE blocks) and then USE the module wherever you reference a routine or function that needs
an interface block.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also, if the two routines are in the same DLL, I don't think you need the DLLIMPORT directive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anthony,
Thank you for that.
However, being new to this approach to software, I think I may be missing the point.
I thought that the !DEC$ATTRIBUTES lines were the interface block.
Are you saying that I need other commands in addtion to(or instead of) these lines.
Unfortunately, I cannot combine the two files, because, Epilog will be called from every routine in the DLL.
In any case this is just the simple start to a much more complicated file structure.
I was trying to start with an easy case, but fell over at the first hurdle.
When I remove the DLL directive, I get a different link error:
error LNK2019: unresolved external symbol _EPILOG referenced in function Calc_Atmos.
Thanks again for your help - I really appreciate you taking the time.
Unfortunately, I'm not totally on top of this subject yet, and need a little more pointing in the right direction,
Mark.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
INTERFACE
SUBROUTINE EPILOG(EXIT_CODE)
!DEC$ ATTRIBUTES STDCALL, REFERENCE, ALIAS:'Epilog' :: Epilog
INTEGER EXIT_CODE
END SUBROUTINE
END INTERFACE
to the calling subroutine or, better, put it into a module (with all your other
INTERFACE blocks) and then USE the module wherever you reference a routine or function that needs
an interface block.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anthony,
Thank you.
It's working perfectly now.
Sorry that you had to spell it out precisely, but this is new technology for me and I'm still learning.
That's twice you've bailed me out - I appreciate it,
Mark.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page