I am able to build my application, which is a mixed C/Fortran application, on windows without problems using icl and ifl (7.1)
However, when I port the source code to Linux, I cannot have my C functions linked to the Fortran objects. Below is small mixed C/F9x application that illustrates what I experience in my original application.
There is a "main.for" which calls a C function (fact.c) to compute the factorial of an integer.
When linking the objects with ifc 7.1, I get the following error.
$> ifc src/main.o src/fact.o -o src/fact -lcxa -C90
src/main.o(.text+0x20): In function `main':
: undefined reference to `FACT2'
Here are the files. My linux box is RH 8.0. Any help would be truly appreciated. Note, the function name in fact.c is (deliberately) aliased and made uppercase.
C-- file 1: main.for --
INTEGER FUNCTION FACT( N)
!MS$ ATTRIBUTES C,ALIAS:'FACT2'::FACT
INTEGER N [REFERENCE]
END FUNCTION FACT
f1 = FACT(10)
write (*,*) 'fact = ', f1
/**** file 2: fact.c *****/
int FACT2( int *n)
int i, f = 1;
for (i=1;i<=*n;i++) f = f * i;