Calling FTN95 from C/C++

Calling FTN95 from C/C++

In this section:

The following text assumes that you are writing in Silverfrost C/C++ and are calling an FTN95 relocatable binary library (RLB) or dynamic link library (DLL).

When calling FTN95 routines from C/C++, the following major points should be considered:

•  Fortran arguments are passed by reference rather than value.

•  All Fortran external names are upper case (regardless of the case of the original source text).

•  Fortran character variables have no simple analogue in C/C++.

If you have a C/C++ main program calling a Fortran RLB, then the main program should call the library initialisation routine if there is one. Failure to do so will result in unpredictable behaviour. If you are calling a DLL then the initialisation will probably take place automatically when the DLL is loaded.

For a practical example of how to call an FTN95 DLL from a Visual C++ program see the following topic, which includes example source code.

Visual C Interoperabilty - Calling an FTN95 DLL from Visual C++ (Win32)

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited