calling a fortran subroutine from a C main routine

calling a fortran subroutine from a C main routine

On Sun UNIX, I used to be able to call a fortran routine from C main routine. In detail,
----- C routine: test2_f_land_2.c
void main(){
int f_land_2_();
printf(%c", f_land_2_(&lat, &lon) );
---- Fortrain subroutine
integer function f_land_2(lat,long)
---------
But when I ported the codes to Tru64 Unix, and compile it as
test2 : test2.o f_land_2.o
$(CC) test2.o f_land_2.o $(LIBS) -o test2
I get an error:
cc -I./ -I~sk/tp/prog/libraries/headers -g -c test2_f_land_2.c
f77 test2_f_land_2.o f_land_2.o -lm -o test2_f_land_2
ld:
/usr/lib/cmplrs/fort90/for_main.o: main: multiply defined
Unresolved:
MAIN__
f77: Severe: Failed while trying to link.
*** Exit 1
Stop.

Can anyone suggest how I can properly link? I tried f90 & f95 - no luck
Thanks

1 envío / 0 nuevos
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.