- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
23 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have built the DLL in a debug configuration. This introduces dependencies that don't allow for copying the DLL to a system where CVF is not installed. It is not clear to me if this is the issue, but it sounds as if it may be.
Rebuild as a Release configuration. If you are running on a system where CVF is not installed, download and install the Redistributables Kit.
The next thing to understand is how Windows searches for DLLs. It looks in the following locations (I may not have the order right):
- Current directory
- Directory containing the EXE that asked for the DLL (directly or indirectly)
- Directories in PATH
- Windows directory
- Windows System directory
Note that when running in Developer Studio, the current directory is set to the project folder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the advice. I tried rebuilding the programs in Release mode. Still no go. The directories are:
C:... etention etention for the DLL and
C:... etention estretention for the EXE
with the DLLs and EXEs being in the release and debug subfolders. It's not a problem of getting it to work on a computer without CVF as I'm trying to execute the program from inside CVF. I tried placing the EXE folder as C:... etention etention estretention, but still no go.
C:... etention etention for the DLL and
C:... etention estretention for the EXE
with the DLLs and EXEs being in the release and debug subfolders. It's not a problem of getting it to work on a computer without CVF as I'm trying to execute the program from inside CVF. I tried placing the EXE folder as C:... etention etention estretention, but still no go.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the complete and exact text of the error message?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The error message is:
This application has failed to start because retention.dll was not found. Re-installing the application may fix this problem.
This application has failed to start because retention.dll was not found. Re-installing the application may fix this problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adam, I don't quite follow your setup, but here's a piece of advice about setting up the workspace in case of multiple projects -- it might help.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It appears to be a run-time problem. It appears to compile and link correctly, as the error message doesn't appear until I try to execute the program.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I understand, and the suggestion in the link I referred to solves exactly that. The simplest way to develop a multiple-module solution is to ensure that the .exe and .dll's are in the same directory.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry. Didn't mean to be insulting. I'll give your procedure another shot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To help diagnose this, right click on the EXE and select View Dependencies. (If that option isn't there, let me know.) It will display all the DLLs your EXE is dependent on, and will indicate which ones can't be found.
Try putting your DLL in the same folder as the EXE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where should I click for the EXE? Bringing up the properties for the file I compile into an executable shows no dependencies. Right-clicking the actual executable file only brings up the normal Windows options. Is there a way to see the executable inside Dev Studio that I'm not seeing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you ever study the CVF DLL samples that come on the CD?
IMO it's the best place to start in trying to get into the hang of VS.
Ciao,
Gerry T.
IMO it's the best place to start in trying to get into the hang of VS.
Ciao,
Gerry T.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't mean inside Developer Studio. It could be that the Dependency Viewer is not available to you.
Try this instead. Download ftp://ftp.compaq.com/pub/products/fortran/vf/supp/loadtest.exe and put it in the same folder as your EXE. Open a command prompt window and CD to that folder. Then type:
loadtest yourexename.exe
What does it say?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okay, I did that. The message is:
About to load: testretention.exe
Image: testretention.exe loaded OK
Done
About to load: testretention.exe
Image: testretention.exe loaded OK
Done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. Are you still having problems running the program then?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it is still giving me the same missing DLL error message. I have the feeling I just missed some setting somewhere or something, but I can't track it down.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you run the EXE by double-clicking on it? I can't see how LOADTEST would succeed but running it wouldn't.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, it gives the same error message when executed either from Dev Studio or when I attempt to run it from Windows by double-clicking.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't see how you would get the error when double-clicking, but LOADTEST worked ok.
Please try loadtest again but this time use the -d switch:
loadtest -d yourexe.exe
What does it say?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
g.f.thomas wrote:
Did you ever study the CVF DLL samples that come on the CD?
IMO it's the best place to start in trying to get into the hang of VS.
Ciao,
Gerry T.
I have tried, but I cannot get the example files to compile properly. I'm not sure what I'm doing wrong, as I set up different workspaces for it and they still don't want to go. As far as I can tell, there is no tutorial documentation on how to use them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sblionel wrote:I can't see how you would get the error when double-clicking, but LOADTEST worked ok.Please try loadtest again but this time use the -d switch:loadtest -d yourexe.exeWhat does it say?
Okay, now it doesn't work. The message in the command prompt is:
Image load at 400000 of: testretention.exe
DLL load at 77f50000 of: ntdll.dll
DLL load at 77e60000 of: C:WINDOWSsystem32kernel32.dll
And then it pops up a dialog box giving the familiar message:
This application failed to start because retention.dll was not found. Re-installing the application may fix this problem.
Then more error messages appear in the command prompt after closing the dialog box:
Exception: 0xc0000135 (3221225781.) - (Unable To Locate Component) This application has failed to start because %hs was not found. Re-installing the application may fix this problem.
Remote process terminated unexpectedly
Process exit status was: 0x79 (121.) - The semaphore timeout period has expired.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page