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

fortran program calling c++ dll - dll only found if I copy it over??

brochamb
Beginner
493 Views
Hi there,

I have a program written in Fortran that calls functions from a dll written in C++. But when I run it I get an error saying that it failed to start because the dll was not found. Everything works fine if i copy the dll over to where the Fortran executable is, but I won't be able to do that later on.

Is there a ways to give the DLLIMPORT command a path to where the dll is? I have the .lib file added to my project, which the project doesn't compile without, but it doesn't seem to help with locating the dll.
0 Kudos
3 Replies
Steven_L_Intel1
Employee
493 Views
No, there isn't. Your DLL is dependent on other DLLs that can't be found. Is your DLL built as a "debug configuration"? If so, rebuild it as a "release configuration" and that may help. But you probably have to install the MSVC run-time DLLs. Which version of Visual Studio are you running?
0 Kudos
brochamb
Beginner
493 Views
Thanks for the reply, I'll try building as release when i get to work tomorrow. I am running it with Visual Studio .NET 2003. The machines do have 2005 also, but I had been using 2003 for everything else so I haven't tried 05 yet.
0 Kudos
Steven_L_Intel1
Employee
493 Views

Visual C++ 2005 redistributables package

For Visual Studio.NET 2003, you will probably have to copy msvcr71.dll along with your executable.

0 Kudos
Reply