Message-ID: <331AB987.2EA1@sprynet.com> Date: Mon, 03 Mar 1997 06:44:07 -0500 From: Jerry A Green Reply-To: graphyx AT sprynet DOT com Organization: Custom Solutions MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: g77 calling C calling g77 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I am looking for calling conventions for calling C routines from FORTRAN and vice versa. One puzzling feature that I have run across it that a C function referenced from FORTRAN must have an underscore postpended to name of the C function source: SUBROUTINE FcallC () INTEGER ITEMP ITEMP = Cfunc() RETURN END int cfunc_() { ... } Now, if I have a group of pre-existing C routines, does that mean that I must edit all of the routines to add the post-pended underscore in order to call them from FORTRAN? What about the reverse sequence, calling FORTRAN from C? Who gets the underscore?