Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site hao.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!whuxlm!akgua!sdcsvax!sdcrdcf!trwrb!trwrba!cepu!hao!woods From: woods@hao.UUCP (Greg Woods) Newsgroups: net.lang.f77 Subject: Re: main() vs. MAIN_() Message-ID: <1364@hao.UUCP> Date: Tue, 5-Feb-85 15:01:35 EST Article-I.D.: hao.1364 Posted: Tue Feb 5 15:01:35 1985 Date-Received: Fri, 8-Feb-85 03:44:03 EST References: <23500005@uiucdcsb.UUCP> Organization: High Altitude Obs./NCAR, Boulder CO Lines: 18 The problem is that you need to initialize the FORTRAN I/O routines. I have never actually attempted this, but at the minumum, you need to call f_init() before attempting any I/O, and f_exit() before exiting. You could look in the file /usr/src/usr.lib/libF77/main.c and see how they do it there. There's lots of other associated garbage in there as well. If your main program is C, and you use this method, do *not* use f77 to link the files, or you will wind up with "MAIN_" as an undefined symbol (f77 calls ld with the "-u MAIN_" flag to force loading of the FORTRAN program). Instead, you will need to use "cc whatevers.o -lwhatevers -lF77 -lI77 -lU77 -lm". --Greg -- {ucbvax!hplabs | allegra!nbires | decvax!noao | harpo!seismo | ihnp4!noao} !hao!woods "...sometimes the light's all shining on me; other times I can barely see..."