From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,4ccf10f7e3a0332c,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-08-08 09:49:15 PST Path: bga.com!news.sprintlink.net!hookup!swrinde!howland.reston.ans.net!spool.mu.edu!news.clark.edu!netnews.nwnet.net!news.u.washington.edu!trieste.stat.washington.edu!neal From: neal@trieste.stat.washington.edu (Phil Neal) Newsgroups: comp.unix.osf.osf1 Subject: Mixed language programming summary Date: 8 Aug 1994 16:38:22 GMT Organization: U. Washington Dept. of Statistics Message-ID: <325n1u$rm1@news.u.washington.edu> NNTP-Posting-Host: trieste.stat.washington.edu X-Newsreader: TIN [version 1.2 PL2] Dear osf1/alpha people, My original problem was how to get rid of all the error messages when linking a C main with a Fortran subroutine. Thanks to all who replied !! In summary, check out the following: 1. Use -nofor_main if you have a C main routine. This gets rid of the "MAIN__" unresolved problem. f77 -v test.o testit.o -o test.exe -nofor_main 2. Use -assume-no-underscore if you don't want to hassle the trailing underscores. 3. Use for_rtl_init_ and for_rtl_finish_ as magic mojo to clean up after poorly implemented fortran i/o. 4. link with cc but include the -lfor library: test.exe: test.o testit.o # f77 -v -nofor_main testit.o test.o cc -o test.exe test.o testit.o -lfor clean: rm *.o *.exe 5. This makefile also worked: CC= cc LIBS= -lUfor -lfor -lFutil -lm -lots -lc test.exe: test.o testit.o $(CC) -v test.o testit.o -o test.exe $(LIBS) clean: rm *.o *.exe Many thanks to: Dan Riley Castor Fu Tom Milac Allen Cohen Rudolf Gabler David Warren Dr. Thomas P. Blinn Richard H. Broberg jim@ilo.dec.com Peter Schmitzberger Jorge Pizarro Phil -- ---------------------------------------------------------------- Phil Neal, Systems Programmer, Statistics Department GN-22 University of Washington, Seattle, Wa. 98195 USA | 206-685-1627 http://www.stat.washington.edu/phil.html ---------------------------------------------------------------- Those who would repeat the past must control the teaching of history. (Bene Gesserit Coda)