mixed language help needed

Dan, Ho-Jin hjdan@kaist.ac.kr
Mon Dec 10 10:55:00 GMT 2001


Attached file may help you. If you use c++ instead of c, the prototypes 
of fortran
subroutines are begin with the keyword [[extern "C" ]]

Best Regard
Dan, Ho-Jin


Juan Nastri wrote:

>Hello,
>I am writing a new main for an old program written in fortran and I am
>looking for a light somewhere.
>The general idea is to use the old fortran subroutines, and make the new
>main in plain C.
>I have read a lot of pages, speaking about mixed language, and a lot of
>different things where suggested.
>But what I need is quite simple.  I need a concrete example on how to
>link a subroutine.f with a main_program.c.
>Lets say, that the subroutine uses 2 integer as a parameters.
>Exactly what should I tell to gcc and g77 to correctly compile this??
>and example of a makefile would be usefull too!
>
>Thank you at least to read this.  If you can help me, I would be very
>happy.
>Juan
>Ps. Please, forgive my poor english, is not my natural language.
>
>
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: f2c.tar.gz
Type: application/x-gzip
Size: 148048 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20011210/29a13e8a/attachment-0001.bin>


More information about the Gcc-help mailing list