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

Visual Basic callinf Fortran DLL - Unable to load DLL on Win7

Kipling__Michael
Beginner
704 Views

I am getting the message "Unable to load DLL" when trying to run a program I built with a Visual Basic Gui calling a Fortran DLL.

I built the program using VS2008 on a XP64 machine, where it works fine in Release mode.

Using VS2008, I have built several applications with VB GUI's calling Fortran DLL's that work fine on Win7.

The new program I'm working on runs fine on my XP64 machine in release mode, but on a Win7 machine I get the "Unable to load DLL" message.

I can make this message appear on my XP64 machine if I set the Fortran/Libraries setting to "Multithreaded DLL" instead of "Multithreaded".

I've compared a successfull solution's project settings with this one, but can't find a difference.

I've also run the VS2008 redritributable on the Win7 machine to no avail.

Any suggestions?

Mike K

0 Kudos
4 Replies
Steven_L_Intel1
Employee
704 Views

VB will give this error if any dependent DLLs can't be loaded.  Since your DLL is linked to the DLL libraries, that means it is dependent on both the Intel Fortran and Microsoft Visual C++ run-time DLLs that would then need to be installed on a system where Intel Fortran (and the same version of Visual Studio) was not installed.  See What do I need to deploy my Fortran application on a system where the compiler is not installed? for more information.

0 Kudos
Kipling__Michael
Beginner
704 Views

Steve,

I am using Visual Fortran 2011.11.344.  Can I use the 2013 redistributables?  (I'll be upgrading to VS2010 and VF2013 shortly.)

I have another similiar app which is running successfully on the same Win7 machine.

Mike K

0 Kudos
Steven_L_Intel1
Employee
704 Views

Yes, you can use the newer redistributables.  Use Dependency Walker to diagnose this sort of problem.

0 Kudos
Kipling__Michael
Beginner
704 Views

I had used Dependency Walker on the executable, but not on the Fortran DLL since I was sure it was OK.  I should have.

It turned out that some other DLL's were being called from the Fortran routines.

Thanks,
Mike

0 Kudos
Reply