Calling Fortran subroutines from C++

Toon Moene toon@moene.indiv.nluug.nl
Fri Oct 26 13:03:00 GMT 2001


Paolo Carlini wrote:

> I assume that you are using gcc/g77.
> 
> Apart from the linkage conventions to be used on the C++ side, part of
> the ISO standard, I wonder if you have already consulted the material
> specific to gcc/g77 included in the info pages. Do you have them
> installed?
> That documentation is also available online (for 2.95.3, 3.0.x, 3.1
> experimental) at http://gcc.gnu.org/onlinedocs/ , G77 Manual, see, in
> particular, 12. Other Languages.

In addition to this I might add that you probably need to use g++ to do
the final link when building the executable from the libraries.

Do not forget to add -lg2c -lm to the "link" command line, in that case.

Hope this helps,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)



More information about the Gcc-help mailing list