Hi,
I'm trying to call some Fortran 95 code in C, but I'm having problems with integers not having the same value in C as in Fortran, and changing values upon each run of the program. I think it has to do with the integer type, but I don't know how to fix it. I'm running Gentoo x86.
Here are the files I've got:
foo.c:
Code:
#include <stdio.h>
extern int qux_();
main() {
printf("%d\n", qux_());
return 0;
}
bar.f:
Code:
subroutine qux()
integer qux = 0
return
end subroutine qux
compile.sh:
Code:
#!/bin/bash
gcc -c foo.c
gfortran -c bar.f
gcc -o baz foo.o bar.o
GCC information:
Code:
# gcc --version
gcc (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) 4.3.2
Thanks in advance for the help!