- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am using Intel Fortran v.10 and was wondering how to use whatI used in Lahey by calling
DLL_EXPORT :: SubroutineName
I am note sure if its an option i have chosen but it obviously doesnt compline. I also tried something i found a couple people used
!cDEC$ ATTRIBUTES DLLEXPORT :: SubroutineName,either commented or not
So I get the error, not able to make an entry point, which seems like it is not finding the subroutine.
Any help is appreciated
Jeremy
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
ok, that seemed to make the statement 'uncommented', so i compiled it and put it in my C# debug file and it still gives me the same error, no entry point, a made a very basic program to make this call, the subroutine for fortran looks like:
Subroutine
Gauss(i)!DEC$ ATTRIBUTES DLLEXPORT :: Gauss
implicit none
integer
ii = 3
end subroutine
The way that i've done it for VS2003 fortran is, from c# i would say:
[
DllImport("RadLabLibrary.dll", CallingConvention = CallingConvention.StdCall)] public static extern void Gauss(ref int intNum);at the top of the class, where RadLabLibrary is the dll in my c# debug file, and then i would make the call: Gauss(i), is this still the same for Intel Fortran, am i missing an option somewhere or why is not finding an entry point , thanks
Jeremy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
extern "C" void GAUSS
Fortran upcases names by default and you need the "C" to avoid C++ name mangling. If you don't want to change the name, use this in Fortran instead:
!DEC$ ATTRIBUTES DLLEXPORT,DECORATE,ALIAS:"Gauss" :: Gauss
Also, remove the calling convention specification from the C++, as STDCALL is not the default in Intel Fortran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
so in C# (or C++) you have to name the subroutine GAUSS capitalized or do that other dllexport call,
what isinteresting is that i never had to do that with Lahey fortran i could just say Gauss_f or whatever,
is lahey one of the few compiliers who do that? i forget what the stdcall was used for but use to be necessary
now if i could just figure out how to get lahey VS03 IMSL library to work i would be set, thanks for your help
Jeremy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't imagine how Lahey manages to resolve the case-sensitivity of C++ with the case-insensitivity of Fortran. STDCALL would be used if you were using Compaq Visual Fortran, but not for Intel Visual Fortran.

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