Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

what is the problem on my program?

lyricx
Beginner
530 Views
to call a dll from Fortran, I encountered the following error:
----
Compilation Aborted (code 3)
----
what is the problem, thank you very much for your explaination.
----------------------------------------------
PROGRAM DLLTEST
use kernel32
! USE DFWIN
IMPLICIT NONE
INTERFACE
SUBROUTINE ARRAYTEST (sarray)
!DEC$ ATTRIBUTES DLLIMPORT:: ARRAYTEST
REAL(4) sarray(3, 7)
END SUBROUTINE ARRAYTEST
END INTERFACE
REAL(4) sarray(3,7)
integer:: p
pointer (q, ARRAYTEST)
! First, locate the dll and load it into memory
p = loadlibrary("ARRAYtest.dll"C)
if (p == 0) then
type *, "Error occurred opening ARRAYtest.dll"
type *, "Program aborting"
stop
endif
! Set up a pointer to the routine of interest
q = getprocaddress(p, "ARRAYarr"C)
if (q == 0) then
type *, "Error occurred finding ARRAYarr in ARRAYTEST.dll"
type *, "Program aborting"
stop
endif
CALL ARRAYTEST(sarray)
WRITE(12,*) sarray(:,:)
END PROGRAM DLLTEST
0 Kudos
1 Reply
Steven_L_Intel1
Employee
530 Views
I don't get an error when compiling this source with 9.0.030.
0 Kudos
Reply