linking C and Fortran

Bill Johnston [csam] johnston at lbl-csam.arpa
Wed Jul 30 16:53:26 AEST 1986


What needs to be done (other than ensuring consistent data types
for args) in order to link C and/or Fortran main programs and
routines with each other? How do the necessary libraries get
specified at link time (manually?), and what else needs to be done?
I mostly need to call Fortran from C, but visa versa also.

For example:

	f77 -c forsub.f
	forsub.f:
      	   forsub:
	
	cc -c cmain.c
	cc cmain.o forsub.o -o cmain
	Undefined:
	_forsub

I could understand why there might be some missing Fortran references
generated in forsub since cc doesn't reference the Fortran library.
But why isn't forsub found?

Any help or pointers to information would be appreciated.

	Thanks, Bill Johnston
	[wejohnston at lbl.arpa, ...ucbvax!lbl-csam!johnston]



More information about the Comp.unix.wizards mailing list