This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]