- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a Fortran DLL project that I am building in IVF11.1. The DLL has entry points that i would like to call from VB.net (VS2008) and also from Excel VBA macros. To find the entry points, i included in the following two lines in each fionction/subroutine that i call from vb.net/excel:
!dec$ attributes dllexport :: MW_fnc
!dec$ attributes stdcall, REFERENCE, alias :'MW_F' :: MW_FNC
The name of the function, in this case, is real(8) Function MW_fnc.
This allows me to then DECLARE the function MW_F in VB.net and in Excel VBA.
The problem is this -- the source code is split up into a few different files. The MW_FNC routine is contained in FILEA.f. There is a second routine (SABS_F) that makes use of this function, but it is in FileB.f. WhenI compile/link the code, i get the error:
Error 11 error LNK2019: unresolved external symbol _MW_FNC referenced in function SABS_F. entropy.obj
I also end up with warnings that are something like this for other functions that do not have the second DEC statement (i.e., they are not aliased):
Warning 5 warning : locally defined symbol __imp__DENSITYSITOIP_FNC imported Release\h_air.obj
Warning 10 warning LNK4217: locally defined symbol _DENSITYSITOIP_FNC imported in function _GETDENSITYFORFLOWRATE_FNC h_air.obj
I am pretty sure this all has to do with the DLLEXPORT, STDCALL, and ALIAS attributes, but i am at a loggerhead. Can someone help me?
Kirby
!dec$ attributes dllexport :: MW_fnc
!dec$ attributes stdcall, REFERENCE, alias :'MW_F' :: MW_FNC
The name of the function, in this case, is real(8) Function MW_fnc.
This allows me to then DECLARE the function MW_F in VB.net and in Excel VBA.
The problem is this -- the source code is split up into a few different files. The MW_FNC routine is contained in FILEA.f. There is a second routine (SABS_F) that makes use of this function, but it is in FileB.f. WhenI compile/link the code, i get the error:
Error 11 error LNK2019: unresolved external symbol _MW_FNC referenced in function SABS_F. entropy.obj
I also end up with warnings that are something like this for other functions that do not have the second DEC statement (i.e., they are not aliased):
Warning 5 warning : locally defined symbol __imp__DENSITYSITOIP_FNC imported Release\h_air.obj
Warning 10 warning LNK4217: locally defined symbol _DENSITYSITOIP_FNC imported in function _GETDENSITYFORFLOWRATE_FNC h_air.obj
I am pretty sure this all has to do with the DLLEXPORT, STDCALL, and ALIAS attributes, but i am at a loggerhead. Can someone help me?
Kirby
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You must repeat the ATTRIBUTES line with STDCALL and ALIAS in any routine that wants to call the exported routine. The warnings are harmless and can be ignored.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You must repeat the ATTRIBUTES line with STDCALL and ALIAS in any routine that wants to call the exported routine. The warnings are harmless and can be ignored.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
You must repeat the ATTRIBUTES line with STDCALL and ALIAS in any routine that wants to call the exported routine. The warnings are harmless and can be ignored.
This previous thread in the forum may give you the answer you need
David

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