Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199904220400.XAA13644@modi.xraylith.wisc.edu> X-Authentication-Warning: modi.xraylith.wisc.edu: localhost.xraylith.wisc.edu [127.0.0.1] didn't use HELO protocol To: John McNally cc: "gnu-win32 AT cygnus DOT com" Subject: Re: jni,egcs1.1.2 compiling problem In-reply-to: Your message of "Wed, 21 Apr 1999 19:17:33 PDT." <371E86BD DOT 91C757B9 AT tempest DOT engr DOT ucdavis DOT edu> Date: Wed, 21 Apr 1999 23:00:02 -0500 From: Mumit Khan John McNally 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