FW: how do I link a C function with a gfortran program

jimmie.davis@l-3com.com jimmie.davis@l-3com.com
Tue Jan 2 19:10:00 GMT 2007


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



More information about the Gcc-help mailing list