www.delorie.com/gnu/docs/gcc/g77_522.html   search  
Buy the book!

Using and Porting GNU Fortran

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12.1 Tools and advice for interoperating with C and C++

The following discussion assumes that you are running g77 in f2c compatibility mode, i.e. not using `-fno-f2c'. It provides some advice about quick and simple techniques for linking Fortran and C (or C++), the most common requirement. For the full story consult the description of code generation. See section 13. Debugging and Interfacing.

When linking Fortran and C, it's usually best to use g77 to do the linking so that the correct libraries are included (including the maths one). If you're linking with C++ you will want to add `-lstdc++', `-lg++' or whatever. If you need to use another driver program (or ld directly), you can find out what linkage options g77 passes by running `g77 -v'.

12.1.1 C Interfacing Tools  
12.1.2 Accessing Type Information in C  
12.1.3 Generating Skeletons and Prototypes with f2c  
12.1.4 C++ Considerations  
12.1.5 Startup Code  

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003