Path: utzoo!mnetor!uunet!husc6!rutgers!ames!necntc!linus!rr From: rr@linus.UUCP (Robert Rifkin) Newsgroups: comp.lang.c Subject: linking with Fortran subroutines Message-ID: <20615@linus.UUCP> Date: 28 Dec 87 13:41:41 GMT Reply-To: rr@linus.UUCP (Robert Rifkin) Distribution: na Organization: The MITRE Corporation, Bedford MA Lines: 27 I am trying to link C code with some canned Fortran routines (the NAG math library) on a Unix-based system. I understand that Fortran subroutines pass arguments by address, so the calling C code must use addresses to be compatible. However, one snag that I still have is that the Fortran routine passes a function name through the subroutine call e.g. external function . . call x (function, a,b,c...) where "function" is the function , and a,b,and c are variables. I believe that what Fortran does is that "function" passes the address of where the actual function begins. I've tried C-code calls like double precision *functioin( ); . . x_(function, &a,&b,&c); to no avail. Does anyone have any suggestions for solving this problem? -- Robert Rifkin Phone: (617) 271-2302 The MITRE Corporation ARPA: linus!rr@MITRE-BEDFORD Bedford, MA 01730 UUCP: decvax!linus!rr