C calls FORTRAN subroutine

Aldrin Leung leung at imsvax.UUCP
Fri Oct 12 07:07:04 AEST 1984


I have difficulty to use a C main program to call a Fortran
subroutine that have I/O and would like anybody have
related experience to give me some help.  I usually don't
read mail under unix.wizard.  Please send mail to me.  The
following is what I did.

In the C program, I have
----------
#include <stdio.h>

main()
{
try_()
}
----------

In the Fortran program, I have
----------
      subroutine try
      write (6,100)
100   format ("subprogram")
      end
----------

I use "cc -c main.c", "f77 -c try.f", and
"cc main.o try.o -lF77 -lU77 -lI77"

No output like "subprogram" is printed.

Thanks in advance!

Aldrin Leung
...umcp-cs!eneevax!imsvax!leung  or
...umcp-cs!cvl!elsie!leung



More information about the Comp.unix.wizards mailing list