Re: FORTRAN DLL and CALL_EXTERNAL [message #11640 is a reply to message #11630] |
Thu, 21 May 1998 00:00  |
steinhh
Messages: 260 Registered: June 1994
|
Senior Member |
|
|
Shane wrote,
> I'm trying to get call_external working under NT4 (i.e. using DLL's)
> using FORTRAN. Has anybody done this before with success? Is there any
> example code (like there is for C in the Advanced development
> guide)...please this would help alot?. The tools I'm using are IDL
> v.5, Digital visual fortran and NT4.
If you can get a DLL written in C to work, and if you can get
a normal C-program to call a FORTRAN subroutine, then you
simply make a C wrapper that calls the FORTRAN subroutine,
and make the DLL by linking the C wrapper + FORTRAN compiler
output (not linked, just compiled) together into a DLL.
Your IDL routine should then call the C wrapper.
If you can't get a C-source DLL to work, you should consult
the Adv. dev. guide + the man pages for your C compiler.
If you can't get a C program to call a FORTRAN routine,
consult the C and FORTRAN man pages.
Hint: Some times there is a lot of problems identifying
the names of subroutines from one compiler to another,
due to various name-altering conventions. Some compilers
put an underscore (or two!) at the beginning or end
of compiled functions, some don't.
Look in the ...idl/external/sharelib directory for examples
of both C and FORTRAN examples.
Regards,
Stein Vidar
|
|
|