[Prev][Next][Index][Thread]

summary mixed language programming




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

6.	

Many thanks to:


Dan Riley
Castor Fu
Tom Milac
Allen Cohen
Rudolf Gabler
David Warren
Dr. Thomas P. Blinn
Richard H. Broberg
jim@xxxxxxxxxxx
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)