From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,362bb81d057bfb5d,start X-Google-Attributes: gid1164f8,public X-Google-Thread: 1094ba,362bb81d057bfb5d,start X-Google-Attributes: gid1094ba,public X-Google-ArrivalTime: 1992-04-07 08:50:41 PST Xref: sparky comp.lang.fortran:1773 comp.sys.dec:2486 Path: sparky!uunet!wupost!darwin.sura.net!gatech!mcnc!borg!cs.unc.edu!emmart From: emmart@cs.unc.edu (Niall Emmart) Newsgroups: comp.lang.fortran,comp.sys.dec Subject: Mixing fortran and C on a DECstation 5000 Keywords: f_init, f_exit Message-ID: <11097@borg.cs.unc.edu> Date: 7 Apr 92 15:50:41 GMT Sender: news@cs.unc.edu Reply-To: emmart@cs.unc.edu Followup-To: comp.lang.fortran Organization: Microelectronic Systems Laboratory, UNC Chapel Hello... I'm trying to get some old code running that mixes fortran and C. The C code has the main routine, which does argument cracking and calls fortran routines to perform functions like dft, and fft. The C code looks something like this: main() { . . . f_init(); . . /* do useful work */ . f_exit(); exit(0); } When I try to compile this, (using f77, V3.1) I get link errors stating that f_init and f_exit are undefined. Deleting these lines seems to cure the problem. The program produces the right output, etc... My questions are: 1) should I call something in place of those routines? 2) are there any side effects of not calling these routines? For example, not being able to catch numeric errors such as divide by zero? 3) are there any other gotchas that I might not know about, that occur mixing fortran and C? 4) are there any online documents which describe mixing fortran and C? Thanks very much, Niall Emmart