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

Unable to load DLL

Kipling__Michael
Beginner
975 Views
I have an application which uses a Fortran DLL to perform calculations. I originally built the interface for it using Delphi. I have now converted the interface to Visual Basic. The application works fine on any machine which has Visual Studio loaded on it, but on a bare machine it says that it can't load the Fortran DLL when the program is asked to perform the calculation which calls routines from the Fortran DLL.I have copied a couple thousand dll's from my machine to the bare machine that I thought it might need, but it did not help.

Iinstall the following files with the application:
libifcoremd.dll
libifportmd.dll
libmmd.dll
msvcr80.dll
Microsoft.VC80.CRT.manifest

I have used dependency walker, but do not see anything I have missed.

Any suggestions?

Mike
0 Kudos
1 Solution
Steven_L_Intel1
Employee
975 Views
It is not sufficient to copy the Microsoft C++ DLLs - you need to install their shared assembly. You can get the Microsoft installer for that here. (This is for VS2005.)

However, if your DLL will not be called by Fortran or C++ code, it may be simpler to change the DLL project property Libraries > Use Runtime Library to "Multithreaded" instead of "Multithreaded DLL". Then you won't be dependent on DLLs.

View solution in original post

0 Kudos
3 Replies
Steven_L_Intel1
Employee
976 Views
It is not sufficient to copy the Microsoft C++ DLLs - you need to install their shared assembly. You can get the Microsoft installer for that here. (This is for VS2005.)

However, if your DLL will not be called by Fortran or C++ code, it may be simpler to change the DLL project property Libraries > Use Runtime Library to "Multithreaded" instead of "Multithreaded DLL". Then you won't be dependent on DLLs.
0 Kudos
Kipling__Michael
Beginner
975 Views
Steve,

You were exactly right again. I changed theRuntime library to "Multithreaded" and it worked.

Would youexplain your comment about the DLL not being called by C++ or Fortran so the Multithreaded DLL was not necessary or point me to documentation explaining this.

Thanks,

Mike
0 Kudos
Steven_L_Intel1
Employee
975 Views
If you built your DLL with the static libraries, and then called the DLL from Fortran or C/C++ code, you would end up with two copies of the Fortran/C++ libraries in the address space that didn't talk to each other. Depending on what the program did, this could lead to odd results or even run-time errors.

If your DLL is called from some other language only, such as VB, Delphi, etc., this is not an issue. I don't know if there is documentation specifically addressing this, but in general, if your DLL may be called from Fortran or C++, you should build the DLL with the DLL libraries (which is the defaut) and, more important, build the executable program so that it also links with the DLL libraries. This tends to be the default for C++ but not Fortran.
0 Kudos
Reply