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

Call DLL from Excel - error: cannot find .dll

uldry__pierre
Beginner
772 Views
Hello,

I am trying to call a DLL that I created with Visual Fortran v11.066, usingvisual studio 2005 IDE, and get the error message in Excel that says: cannot find "*.dll". I went through all the information I found on this site (thank you very much) in order to correct my STDCALL passing etc... but cannot seem to resolve this error.

I used to use CVF 6.6 and only recently moved to the new version. My understanding all along has been that this message is given not only when the *.dll itself is not found but also whenever one of its dependencies is missing. In order to make it work all I used to do was to place DFORRT.DLL in the same directory as my dll. Otherwise I would get the same message as above.I read Steve Lionel's comments and made sure to generate the DLL in its RELEASE version, using static libraries(multithreaded)and looking at the Dependency walker itappeared that I only needed to addthe LIBIOMP5MD.dll, which I thereforeplaced in the directory that contained my DLL.

Now, it works on the machine I developped the DLL but it does not work on my"test" machine.On that "test" pc, I also ran the dependency walker and all seems well: LIBIOMP5MD.DLL is found in the directory. No dependencies seem to be missing...

Any ideas?

Thank you very much,
Pierre
PS: I should add that I am calling the IMSL library in that DLL but since it's in static mode I would just expect it to be linked in or otherwiseshow up as a dependency.
0 Kudos
1 Solution
Steven_L_Intel1
Employee
772 Views
Windows won't find a dependent DLL if you put it in the same folder as the DLL being loaded. It can go in the folder the EXE is in, or in a folder on PATH, or the Windows or Windows System folders. You can try adding /Qopenmp-link:static to the options for building your DLL - that will use the static version of OpenMP which should work for your situation.

View solution in original post

0 Kudos
2 Replies
Steven_L_Intel1
Employee
773 Views
Windows won't find a dependent DLL if you put it in the same folder as the DLL being loaded. It can go in the folder the EXE is in, or in a folder on PATH, or the Windows or Windows System folders. You can try adding /Qopenmp-link:static to the options for building your DLL - that will use the static version of OpenMP which should work for your situation.
0 Kudos
uldry__pierre
Beginner
772 Views
But of course, I should know but I confused myself... I was just sure a dependency was missing.


I tried Qopenmp-link:static in the additional options but that did not work. It would have been great but I know what to do now. Thank you very much!
0 Kudos
Reply