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

Access Violation: Forrtran application to DLL in 32bit windows

$
0
0

I have encountered trouble with a 32-bit application developed with ifort. I have an executable (created in Fortran) that calls a dll (created in C++). The specific error I get at run-time is:

forrtl: severe (157): Program Exception - access violation

I have a feeling my problem spawns from how I call the DLL, or at least something to do with the !DEC$ attributes. I can sucessfully compile and run the program in linux using another compiler, but I am encoutering this trouble when porting it to windows. I call the DLL using these directives:

SUBROUTINE MAP_C2F_CopyInput( InputData, ErrStat, ErrMsg )
  TYPE(MAP_inputtype), INTENT(INOUT) :: InputData
  INTEGER(IntKi), INTENT( OUT) :: ErrStat
  CHARACTER(*), INTENT( OUT) :: ErrMsg
  INTEGER(IntKi) :: i
  ErrStat = ErrID_None
  ErrMsg = ""
  IF ( ALLOCATED( InputData%X ) ) THEN
    i1 = SIZE(InputData%X,1)
    CALL MAP_C2F_Input_X(InputData%C_obj,InputData%X ,i1)
    #if defined(IVF_DLL_CALL_DIRECTIVE)
      !DEC$ ATTRIBUTES STDCALL::MAP_C2F_Input_X
      !DEC$ ATTRIBUTES ALIAS:'_map_c2f_input_x_@12'::MAP_C2F_Input_X
      !DEC$ ATTRIBUTES DLLIMPORT::MAP_C2F_Input_X
    #endif
 ENDIF

...

END SUNROUTINE ...

Any help pointing out to what I've done wrong would be appreciated. 

Thanks,

M


Viewing all articles
Browse latest Browse all 5691

Latest Images

Trending Articles



Latest Images

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