Linking MS Fortran Libraries into Turbo C programs

anibal antonio acero ace3 at quads.uchicago.edu
Thu Nov 29 07:32:46 AEST 1990


Is it possible to link object files or libraries created by/for MS Fortran with
programs written in Turbo C?

Please read on if you're interested or can help..

We have recently intalled a MetraByte A to D converter board in our lab 
computers; we also received some libraries from MetraByte which allow access
to the board's functions.  Unfortunately the header files that were provided
with the libraries are intended for use with Microsoft C (and other Microsoft
language compilers).  I say unfortunately, because our lab has been using
Borland's Turbo C 2.0 exclusively.  Specifically, the key word 'fortran'
appears in most or all the function declarations in the header file.
Turbo C does not understand 'fortran'.

A quick check in my MS MASM Mixed-Language Programming Guide indictated that 
Pascal and Fortran function calls are very similar.  As a stab in the dark,
hoping for a quick fix, I tried:
#define fortran pascal,
since Turbo C does understand 'pascal'.  Unfortunately,  although the example
C programs compiled without error, when executed they did not seem to work
properly.  Compiling the example programs with Microsoft Fortran resulted in
executables that work as advertised.

Can we get these libraries to work with Turbo C, or do we need to buy MSC?

Nitty gritty details:
Hardware DAS-8/PGA (MetraByte A2D board)
Software PCF-8 (Pascal, C and Fortran callable driver software for DAS-8/PGA)

Please send me email if you can offer any suggestions.  I will definitely 
post a summary of responses since the general question, are ms fortran 
libraries accessible from turbo c, seems to be of general interest.

Tony Acero
acero at quads.uchicago.edu	5640 S. Ellis Ave., JFI 340
(312) 702-8214 (lab)		Dept. of Chem., University of Chicago
(312) 702-8387 (office)		Chicago, IL 60637 



More information about the Comp.lang.c mailing list