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

Can't Get EXE To Find DLL

adamanthaea
Beginner
4,811 Views
I'm using CVF and am trying to get the basics of creating a DLL down so I can go on and do something bigger. I can get both the DLL and the EXE to compile properly. However, when I try to execute the program, it won't execute because it can't find the DLL. Here is my code for the DLL:

PROGRAM retention
END

SUBROUTINE VISC (tk, viscosity)
!DEC$ ATTRIBUTES DLLEXPORT :: VISC
REAL tk, viscosity
viscosity=(1.e-6*(5.6159426 + 0.053286909*tk))/(1 + 0.0002676519*tk)
END SUBROUTINE

And the code for the EXE is:

PROGRAM main
!DEC$ ATTRIBUTES DLLEXPORT :: VISC
REAL viscosity, tk
READ *,tk
CALL VISC (tk, viscosity)
PRINT *,tk,viscosity
STOP
END

I've tried just about everything I can think of. Manually moving the DLL to either the project folder or the debug folder results in a DFORRTD.DLL error instead of a missing retention.DLL error. There is probably something incredibly stupid that I'm missing, but I cannot figure out what it is. Each program was coded in it's own little project folder. Any help would be greatly appreciated.
0 Kudos
23 Replies
Steven_L_Intel1
Employee
635 Views
Ok. Now we're getting somewhere. Where is retention.dll? It should be in the same folder as the EXE if you want to run outside of DevStudio. Put it there for now and try loadtest again (and running the program).
0 Kudos
adamanthaea
Beginner
635 Views
Well, I got part of it figured out. The DLL problem is now gone when executing inside Dev Studio and the program works correctly when executed by double-clicking. For whatever reason, moving the DLL physically back into the Release directory does not result in the DFORRT.DLL error but it actually works. Interestingly, the loadtest -d command now gives:

Image load at 400000 of: testretention.exe
DLL load at 77f50000 of: ntdll.dll
DLL load at 77e60000 of: C:WINDOWSsystem32kernel32.dll
DLL load at 10000000 of: C:Program FilesMicrosoft Visual StudioCommonMSDEV98My Projects etention estretentionRelease etention.dll
DLL load at 320000 of: *Unknown*
DLL load at 77c10000 of C:WINDOWSsystem32MSVCRT.dll
0 Kudos
adamanthaea
Beginner
635 Views


sblionel wrote:
Ok. Now we're getting somewhere. Where is retention.dll? It should be in the same folder as the EXE if you want to run outside of DevStudio. Put it there for now and try loadtest again (and running the program).





Thanks for your help. I cannot figure out why it didn't work earlier when I tried moving the DLL. My guess is that it didn't (or doesn't, one of the two) work in the Debug folder and I didn't bother to try doing it in the Release folder until now.
0 Kudos
Reply