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

Problem accessing file from FORTRAN DLL Subroutine

avinash_roshan
Beginner
263 Views

Hello;

I have the following situation:

I have a main function written in FORTRAN and a FORTRAN DLL.

I have one material database file.

Two subroutines has been defined inside the DLL file. One initializes the database file and other access the values defind in it and returns those values.

Inside main the structure of the code is like this:

PARAMETER (matdata='C:Matdatabedatabasefile.db')

PARAMETER (Ndat=31)

PARAMETER (Kdat=24)

CALLdatainit

OPEN(Kdat,FILE=matdata,STATUS='OLD',ERR=500)
READ(Kdat,'(A)') datfil
CLOSE(Kdat)
OPEN(Ndat,FILE=datfil,ACCESS='DIRECT',FORM='UNFORMATTED',
. SHARE='DENYNONE',RECL=3024,ERR=500)
CALL subroutine1('param1',Ndat)

When I compile the main program, the *.exe generated from it is able to access the DLL file. But it throws the error defined inside theDLL "database file not found" athough database file is there which is defined by the keyword here "datfil"

Could you tell me why this is happening. Any sort of help in this regard is welcome

Thankx

Avinash

0 Kudos
1 Reply
Steven_L_Intel1
Employee
263 Views
The main program needs to be linked against the DLL form of the run-time libraries (matching the setting for your DLL.)
0 Kudos
Reply