- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have Compaq Fortran running on a Windows XP machine where I can compile a DLL from Fortran code. I then call this DLL from VB 6 and VB.net without problems. I include dforrt.dll in the directory where the VB project exists.
Below I created a very simple Intel Fortran DLL, which when I try to call from VB.net I get an error message that the DLL cannot be found.
Could you please tell me what I would need to do in order to create a Fortran DLL that can be called from VB.net?
Note: I am a novice programmer.
subroutine TEST(cal,outp)
!DEC$ ATTRIBUTES DLLEXPORT, ALIAS: 'TEST'::TEST
implicit double precision (a-h,o-z)
implicit integer (i-n)
outp=dexp(cal)
RETURN
END
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
He's using CVF. I think the command would be:
df /dll fdll.f90
If the Fortran DLL was not going to be called from Fortran, you could link statically and eliminate the need for dforrt,dll:
df /libs:static /dll fdll.f90
We weren't shown how the routine is declared in VB6, but I'll comment that VB will say "DLL not found" for ANY kind of error it gets loading the DLL
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
He's using CVF. I think the command would be:
df /dll fdll.f90
If the Fortran DLL was not going to be called from Fortran, you could link statically and eliminate the need for dforrt,dll:
df /libs:static /dll fdll.f90
We weren't shown how the routine is declared in VB6, but I'll comment that VB will say "DLL not found" for ANY kind of error it gets loading the DLL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve wrote:
I have Compaq Fortran running on a Windows XP machine where I can compile a DLL from Fortran code. I then call this DLL from VB 6 and VB.net without problems. I include dforrt.dll in the directory where the VB project exists.
Below I created a very simple Intel Fortran DLL, which when I try to call from VB.net I get an error message that the DLL cannot be found.
Could you please tell me what I would need to do in order to create a Fortran DLL that can be called from VB.net?
...
"DLL not found" errors are very often due to some DLL dependencies that are missing on the path. In your case, you may have run-time dependencies (similar to dforrt.dll with Compaq Fortran) for which you may need to take extra steps. Take a look at these topics: https://software.intel.com/en-us/forums/topic/275632, https://software.intel.com/en-us/forums/topic/533439, and https://software.intel.com/en-us/forums/topic/506625.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Intel) wrote:
He's using CVF.
He was using CVF without problems, and is now trying the same with IFort, but has problems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
dforrt.dll will also need msvcrt.dll.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve wrote:
..
Below I created a very simple Intel Fortran DLL, which when I try to call from VB.net I get an error message that the DLL cannot be found.
Could you please tell me what I would need to do in order to create a Fortran DLL that can be called from VB.net?
..
Steve (OP on this topic),
Do you have Microsoft Visual Studio, something other than the Express edition or the shell? If so, you can also take a look at a fully-worked out example of a VB .NET program calling a Fortran DLL in Quote #2 at this topic: https://software.intel.com/en-us/forums/topic/509148.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you to Steve, mecej4, and FortranFan. As I said, I am a novice, but with your various comments/help I have resolved my problej. I have used Visual Studio 2005 and have used the library Debug Multithreaded (/libs:static /threads /dbglibs)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page