Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

DLL depdency question

Brian_Murphy
New Contributor II
1,718 Views

This is a VS IDE question.

I am working on a console application that is somehow connected to several other fortran dll's.  If any of the dll files are missing, the console app will not run.  I can't figure out where in the source code (of the console app) on where in its project settings that the names of the other dll files are specified.  Where do I look for this?

Thanks,

Brian in Austin, Texas

 

0 Kudos
11 Replies
Steven_L_Intel1
Employee
1,718 Views

This is not in the source or the project settings. When running applications, DLLs are loaded according to Windows' default search rules, which include:

- Current directory
- Directory containing the EXE (not the DLL)
- PATH environment variable

There is no control over this from Visual Studio.

0 Kudos
Brian_Murphy
New Contributor II
1,718 Views

Let me give an example.  There is a dll named FEM_IMPEDANCE.DLL, and the console app will run if this file is in the same folder as the exe, but won't run if it's missing.  Why would the console app think it needs this dll?  I cannot find the name of this dll anywhere throughout the project of the console app.

0 Kudos
Brian_Murphy
New Contributor II
1,718 Views

Nevermind.  I think I found it.  In the project explorer there is an item (I think it's a folder) named Linked Library Files, and under that there is a list of *.lib files that seem to correspond to the list of dlls I was looking for.

So if I wanted to remove one of these from the project, I would just delete it from the list.  The next rebuild would then probably tell me if something was needed, like an unresolved external thing for a missing subroutine?

0 Kudos
Brian_Murphy
New Contributor II
1,718 Views

Is there a way to send a screen dump image with a forum posting?

0 Kudos
Brian_Murphy
New Contributor II
1,718 Views

The attached word file shows a small screen dump of the list of .lib files.  Two of them have the same name.  These are referenced from different folders.  What is the meaning of the icons in front them?  One is empty and one has a red dot inside.

0 Kudos
Steven_L_Intel1
Employee
1,718 Views

No, that doesn't help. You have found a list of the DLL export libraries the application links against, but this has no bearing on where the DLLs load from when the program runs.

The best way to include a screen capture is to use a service such as imgur.com to upload a capture and then use the "picture" button here to insert the picture. You can also attach a .jpg or .bmp file when posting here, but you can't insert it inline until after you submit the post (and the re-edit).

0 Kudos
Brian_Murphy
New Contributor II
1,718 Views

The console app seems to always be looking for them in the same folder as itself. That is good, and I don't want to change it. I would like to know the meaning of the red dot, or lack of it.

0 Kudos
Steven_L_Intel1
Employee
1,718 Views

If you mean the red dot in Solution Explorer for the icon on a file, it means that you have overridden project settings for that file.

All applications will look for DLLs in the same folder as the EXE. That is the second place looked for, after the current default folder (which in Visual Studio is the project folder.)

0 Kudos
Brian_Murphy
New Contributor II
1,718 Views

I'm still trying to get my arms around this project, but I am getting there.

In that "Linked Library Files" list of *.lib's, for all except one, each has a corresponding .dll file of the same name that needs to be present for the .exe to run.  The dll for the one outlier doesn't need to be present for the .exe to run.

Would this be due to the .exe not containing any calls to any routines in that one?  Or might there be some other reason?  I'm trying to figure out if it is obsolete, and can be safely removed.

This particular console app has about a 25 year history, and has been worked on by quite a few folks, most of whom were graduate students who are long gone.

0 Kudos
Steven_L_Intel1
Employee
1,718 Views

Right - assuming those are all export libraries, if your program makes no calls to routines in that last library then the DLL will not be pulled in at run-time. You can generate a link map and see if any symbols were resolved in that library, and can also use DependencyWalker to see which DLLs your program references.

0 Kudos
Brian_Murphy
New Contributor II
1,717 Views

I have the Dependency walker.  It's a terrific help in understanding what is in a project.

I did the /MAP and re-link.  The map file is pretty long, but string searching for ".dll" seems to home in on the relevant information.

After more poking around, it looks like some Preprocessor Definitions are used to turn some things on and off.  The need for that outlier dll might be buried in there.  So I've got more digging to do.

Thanks,

Brian

0 Kudos
Reply