This is the mail archive of the mailing list for the Cygwin project. See the Cygwin home page for more information.
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: jni,egcs1.1.2 compiling problem

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 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

  int i = 5;
  f77sub_ (&i);


Want to unsubscribe from this list?
Send a message to