Help: Invalid declaration while calling C function
From: SeanYang (yang22_at_ecn.purdue.edu)
Date: 03/17/05
- Next message: Richard E Maine: "Re: Help: Invalid declaration while calling C function"
- Previous message: J. Greer: "Re: Install Intel Fortran 8.1 on Debian"
- Next in thread: Richard E Maine: "Re: Help: Invalid declaration while calling C function"
- Reply: Richard E Maine: "Re: Help: Invalid declaration while calling C function"
- Reply: Tom Mortimer-Jones: "Re: Help: Invalid declaration while calling C function"
- Reply: E. Robert Tisdale: "Re: Help: Invalid declaration while calling C function"
- Reply: Miriam Born: "Re: Help: Invalid declaration while calling C function"
- Reply: Simon Geard: "Re: Help: Invalid declaration while calling C function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 17 Mar 2005 12:14:47 -0500 To: Sean Yang <Unknow@purdue.edu>
I wanted to call a C function from my Fortran program, but I got an
"Invalid declaration of or reference to symbol" error message as follows
when I compile it. Here is my source code, thank you for help.
>gcc -c myc_func.c
>f77 mytestf.f myc_func.o -o mytestf
mytestf.f: In program 'test.f':
mytestf.f:6
K=myc_func()
Invalid declaration of or reference to symbol 'myc_func'
int myc_func_(){
int value=0;
return value;
}
program testf
implicit none
INTEGER N, K
N=10
K=myc_func()
WRITE(*,30) K
30 FORMAT('The current value is',I16)
CALL EXIT
END
- Next message: Richard E Maine: "Re: Help: Invalid declaration while calling C function"
- Previous message: J. Greer: "Re: Install Intel Fortran 8.1 on Debian"
- Next in thread: Richard E Maine: "Re: Help: Invalid declaration while calling C function"
- Reply: Richard E Maine: "Re: Help: Invalid declaration while calling C function"
- Reply: Tom Mortimer-Jones: "Re: Help: Invalid declaration while calling C function"
- Reply: E. Robert Tisdale: "Re: Help: Invalid declaration while calling C function"
- Reply: Miriam Born: "Re: Help: Invalid declaration while calling C function"
- Reply: Simon Geard: "Re: Help: Invalid declaration while calling C function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]