This is the mail archive of the cygwin@sourceware.cygnus.com
mailing list for the Cygwin project. See the Cygwin
home page for more information.
Re: jni,egcs1.1.2 compiling problem
- To: John McNally <mcnally@tempest.engr.ucdavis.edu>
- Subject: Re: jni,egcs1.1.2 compiling problem
- From: Mumit Khan <khan@xraylith.wisc.EDU>
- Date: Wed, 21 Apr 1999 23:00:02 -0500
- cc: "gnu-win32@cygnus.com" <gnu-win32@cygnus.com>
John McNally <mcnally@tempest.engr.ucdavis.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@sourceware.cygnus.com