Mail Archives: cygwin/1999/04/22/00:01:00
John McNally <mcnally AT tempest DOT engr DOT ucdavis DOT edu> writes:
> Thank you for all your help. Your Fortran JNI example worked fine as
> delivered. However I tried making the fortran function have an integer
> in its argument list. If the function does nothing with the integer
> passed to it it will return ok. If the integer is used in the function,
> however, the program crashes.
>
> This does not appear to be related to JNI, but in calling the Fortran
> routine from C. I'm sure this sort of thing must have been ironed out
> long ago, so it is probably the way I'm doing it.
> I did try compiling with the -mrtd option. I'll try some more tomorrow.
Using my example, you don't need, and don't want, -mrtd.
You're right that it's an issue of C to F77 interfacing. Since it's rather
off topic for this list, I suggest you go over to comp.lang.fortran and
ask. Carsten Arnholm has (at least used to a few years ago) a nice
tutorial at http://home.sol.no/~arnholm/ which you want to check.
Just remember that most implementations of f77 pass arguments by
reference, so the following will match:
subroutine f77sub (i)
integer i
and
int i = 5;
f77sub_ (&i);
Regards,
Mumit
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -