The FORTRAN–Pascal Interface

8

 

 

 

 

 

 

 

 

 

This chapter describes how to mix FORTRAN 77 and Pascal modules in the same program. It contains the following sections:

Compiler Mixed-Language Programs

page 163

 

 

Compatibility of Types for FORTRAN and Pascal

page 164

 

 

General Parameter-Passing in FORTRAN and Pascal

page 167

 

 

Procedure Calls: FORTRAN-Pascal

page 168

 

 

Procedure Calls: Pascal-FORTRAN

page 185

 

 

Routines as Parameters

page 202

 

 

Compiler Mixed-Language Programs

When you compile with the -v(verbose) option, the Pascal driver brings in the runtime libraries for the main module.

However, when you compile a module that is not the main module, and which is written in a language different from the main module, you must explicitly bring in the runtime library on the command-line.

For example, you must use the compiler options –lpfcand –lpcwhen you compile a FORTRAN main routine that calls Pascal. The –lpfcoption links the common startup code for programs containing mixed Pascal and FORTRAN object libraries. The –lpcoption includes the Pascal object library, libpc.

163