Problem to call fortran from C with linux ifc/gcc

From: Ben (
Date: 12/09/03

Date: 9 Dec 2003 14:40:15 GMT


I tried without succes to call a Fortran subroutine with a C program in
a very simple program:

module mod_fortran
  public :: fct_fortran
     subroutine fct_fortran()
         print *,"FORTRAN"
     end subroutine fct_fortran
end module mod_fortran
test.c :
main() {

To compile I used
ifc -c -nus mod_fortran.f90
cc -c test.c
ifc test.o mod_fortran.o

and I get the error compilation :

undefined reference to `fct_fortran'

I tried to see the reference in the .o:

nm test.o :
        U fct_fortran

nm mod_fortran.o:
00000000 T mod_fortran..fct_fortran

Someone has an idea to compile my program ? It seems that the program ca
n't make the link between mod_fortran..fct_fortran and fct_fortran ...



Article poste via Voila News -
Le : Tue Dec 9 15:40:15 2003 depuis l'IP : [VIP 403146271547]