Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Problem with exporting subroutine to DLL

$
0
0

Hi!

I have a problem when exporting code to DLL using the  DLLEXPORT markup. This is compiler version XE 4.0.0.103 on IA-32. I. My main subroutine that I want other applications to be able to access is called subroutine User_Mod(...). I write:

!DEC$ ATTRIBUTES DLLEXPORT,StdCall,Reference,ALIAS:"User_Mod" :: User_Mod                   (1)

However, this gives an error from the compiler:

usrmod.obj : error LNK2019: unresolved external symbol _USER_MOD referenced in function _CLASS_LABTEST_mp_RESULTTABLE.
usrmod.dll : fatal error LNK1120: 1 unresolved externals

(the reason is because the subroutine User_Mod is called elsewhere in the exported code). If I then try to change the export line to:

!DEC$ ATTRIBUTES DLLEXPORT,StdCall,Reference,ALIAS:"User_Mod" :: _User_Mod  (i.e. with underscore)             (2)

the code compiles and a dll is created which is great. However  the  external program that will be using the DLL does not recognize it, so the DLL export will have to be written as in (1). The code works well if I generate an executable, however I am unsure how to solve this problem with underscore.  . Any help or prior experience regarding this would be greatly appreciated.

Thanks.

Jon


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>