Problem to call fortran from C with linux ifc/gcc
From: Ben (broger_at_oreka.com)
Date: 12/09/03
- Next message: Richard Edgar: "Re: problem to compile a single program..."
- Previous message: Steve Lionel: "Re: problem to compile a single program..."
- Next in thread: Arjen Markus: "Re: Problem to call fortran from C with linux ifc/gcc"
- Reply: Arjen Markus: "Re: Problem to call fortran from C with linux ifc/gcc"
- Reply: Erwin Kalvelagen: "Re: Problem to call fortran from C with linux ifc/gcc"
- Maybe reply: Ben: "Re:Problem to call fortran from C with linux ifc/gcc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Dec 2003 14:40:15 GMT
Hello,
I tried without succes to call a Fortran subroutine with a C program in
a very simple program:
mod_fortran.f90:
module mod_fortran
public :: fct_fortran
contains
subroutine fct_fortran()
print *,"FORTRAN"
end subroutine fct_fortran
end module mod_fortran
--------------------------------------
test.c :
main() {
fct_fortran();
}
---------------------------------------
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 ...
Regards
Ben
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Article poste via Voila News - http://www.news.voila.fr
Le : Tue Dec 9 15:40:15 2003 depuis l'IP : icare-pc2.univ-lille1.fr [VIP 403146271547]
- Next message: Richard Edgar: "Re: problem to compile a single program..."
- Previous message: Steve Lionel: "Re: problem to compile a single program..."
- Next in thread: Arjen Markus: "Re: Problem to call fortran from C with linux ifc/gcc"
- Reply: Arjen Markus: "Re: Problem to call fortran from C with linux ifc/gcc"
- Reply: Erwin Kalvelagen: "Re: Problem to call fortran from C with linux ifc/gcc"
- Maybe reply: Ben: "Re:Problem to call fortran from C with linux ifc/gcc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|