PRB: Compilation Errors--$FREEFORM & Graphics Subroutine Calls (50595)



The information in this article applies to:

  • Microsoft FORTRAN Compiler for MS-DOS 5.0
  • Microsoft FORTRAN Compiler for MS-DOS 5.1
  • Microsoft FORTRAN compiler for OS/2 5.0
  • Microsoft FORTRAN compiler for OS/2 5.1

This article was previously published under Q50595

SYMPTOMS

An attempt to compile an application that uses the $FREEFORM metacommand and calls the FORTRAN graphics run-time library fails.

CAUSE

The FGRAPH.FD and FGRAPH.FI files do not conform to the $FREEFORM format.

RESOLUTION

If you must use the $FREEFORM metacommand, you must modify the FGRAPH.FD and FGRAPH.FI files. We recommend that you create customized include files that contain only the information that pertains to the graphics routines your application calls.

MORE INFORMATION

The following code example uses the $FREEFORM metacommand and calls a subroutine in the FORTRAN graphics library.

Sample Code

C Compile options needed: None

      $FREEFORM
      include 'OHMAN.FI'
      subroutine mysub()
      include 'OHMAN.FD'
      call setlinestyle(#AA3C)
      end
				
For this particular example, the OHMAN.FI file contains the subset of FGRAPH.FI that pertains to the setlinestyle subroutine. OHMAN.FI is as follows:
INTERFACE TO SUBROUTINE setlinestyle[FAR,C,ALIAS:"__setlinestyle"] (mask)
INTEGER*2 mask
END
				
Likewise, the OHMAN.FD file contains the subset of FGRAPH.FD that pertains to the setlinestyle subroutine. OHMAN.FD is as follows:
      EXTERNAL setlinestyle
				

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:KB50595