This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
FW: how do I link a C function with a gfortran program
- From: jimmie dot davis at l-3com dot com
- To: <gcc-help at gcc dot gnu dot org>
- Cc: <shermand at westnet dot com dot au>
- Date: Tue, 2 Jan 2007 13:09:03 -0600
- Subject: FW: how do I link a C function with a gfortran program
The convention is that all fortran subroutines have an underscore at the
end.
In your C file, declare it as long read_block_, and in your fortran code
call it 'read_block'.
->Both program and function compile, but when I try to link, I get the
->message, "undefined reference to 'read_block_'."
The linker is asking for a symbol called read_block_. Not read_block.
HTH,
bud