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

make a VS2008-callable DLL from the IVF commandline3

erik2055
Beginner
822 Views
I want to build me a DLL with a routine in it that I can call from a VS2008/VB.NET program.
I suppose I can do that from the IVF commandline.
(I want it that way, because IVF 11 crashes my VS2008 every time I want to build the IVF project)

I try this:

ifort @EN40list2.lst /dll /Qvec-report0 /out:TheRoutine.dll /Qvc9 /fast

dumpbin shows my routine is visible from the outside:
................................
Microsoft COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file TheRoutine.dll

File Type: DLL

Section contains the following exports for TheRoutine.dll

00000000 characteristics
49A5B21F time date stamp Wed Feb 25 22:03:27 2009
0.00 version
1 ordinal base
1 number of functions
1 number of names

ordinal hint RVA name

1 0 00001B80 THEROUTINE

Summary

3000 .data
2000 .rdata
1000 .reloc
14000 .text
............................................................


However: VS gives me a DLLNotFoundException: Unable to load DLL
I checked all paths and names, and they are ok, btw.
Any suggestions ?
0 Kudos
4 Replies
Steven_L_Intel1
Employee
822 Views
I'd be interested in hearing more about the VS08 crash.

It could be that there is a dependent DLL not found in PATH. I suggest downloading Dependency Walker and having it analyze your DLL on the system where you're using it to see what's the matter.
0 Kudos
erik2055
Beginner
822 Views
I'd be interested in hearing more about the VS08 crash.

It could be that there is a dependent DLL not found in PATH. I suggest downloading Dependency Walker and having it analyze your DLL on the system where you're using it to see what's the matter.
Thnx.
Your suggestion results in my suspecting that there is something (not) going on with MSVCR90D.DLL or MSVCR90.DLL
Earlier I had the DLL made from within VS2008 and that went right until VS began crashing.
Now building it from the command line, DepWalker says about the new DLL:

Error: At least one required implicit or forwarded dependency was not found.

, pointing to the MSVCR90.DLL
So I gues I have some CL option missing.
Any suggestion about this would be welcome.

About the crash on Vista : I have no clue about its origin and no clue about where to start investigating either.
It occurs immediately after clicking the BUILD option in the IVF project
It says: An unhandled WIN32 exception occurred in devenv.exe [4508]
and after starting the debugger on that:
Unhandled exception at 0x0919bc4c in devenv.exe: 0xC00000FD: Stack overflow
(something to do with memcpy_s())
After clicking the OK's, it restarts VS.
This is on Vista. XP does the same thing
0 Kudos
Steven_L_Intel1
Employee
822 Views
Are you using this DLL on a system other than the one where you built it? If so, you'll need to install the Visual C++ 2008 Redistributables package Dependency Walker doesn't know how to look at external manifest files. I'm not very familiar with using the manifest tool for embedding manifests - mt.exe. Or, I suppose, you can add /libs:static /threads to link statically.

I would suggest for the VS problems uninstalling all add-ins, including Visual Fortran, from VS and see if it still crashes when you open it. Do a Repair on Visual Studio (from Add/Remove Programs) and then reinstall the integration and see if that helps. That it happens to you on both systems suggests a problem with some integrated software, or perhaps you have a misbehaving antivirus program.
0 Kudos
erik2055
Beginner
822 Views
I'd be interested in hearing more about the VS08 crash.

It could be that there is a dependent DLL not found in PATH. I suggest downloading Dependency Walker and having it analyze your DLL on the system where you're using it to see what's the matter.
About the crashing:

It seems to be some setting in the configuration of the project.
I set up a new project, changed nothing in the configuration and included all the Fortran files in it and did a build: no problem.
Then back to the previous project: Crash.
In the bad project i did some fiddling in the config. Apparently, I did something I did not know the consequences of. On the other hand, maybe there was some setting that should not have been there...
Here is the bad VS project file:

































.... files left out....




0 Kudos
Reply