I need to call a fortran function from C, I have created a fortran.o file for the object call.
I defined the fortran function in C as extern double function();
I use a makefile to compile a bunch of files stored in various directories.
This makefile creates .o files for individual files in their directories and then updates a .a file.
Let’s say my fortran file is in Xyz directory. This directory has xyz.c, xyz1.c and fortran.o files.
Is there a way I can create the fortran.o file and link to the .c file and then update the .a file?
Btw: I think page 248 in the users manual has a typo. it should be $ pgcc -c cmain.c instead of cmain.f