PRB: L2029 Error, FGRAPH.FD, FGRAPH.FI Files Used IncorrectlyLast reviewed: July 18, 1995Article ID: Q48025 |
The information in this article applies to:
SYMPTOMSAn attempt to link an application fails and an L2029 unresolved externals error occurs.
CAUSEThe FGRAPH.FI file is placed at the beginning of the main file and FGRAPH.FD is placed in a subroutine in a separate file. This cause applies ONLY when the symbol name is a graphics function, and it is in all capitol letters with no leading underscore.
RESOLUTIONModify the source code to include the FGRAPH.FI file (the INTERFACE statements) at the beginning of each file that contains a graphics call. Include the FGRAPH.FD file (the variable declarations) in each subroutine that calls a graphics routine. This behavior does not occur with FORTRAN PowerStation. Sample 1 below builds without error.
MORE INFORMATIONFor more information on the FGRAPH.FD and FGRAPH.FI files, see page 180 of the Microsoft FORTRAN "Advanced Topics" manual for version 5.1 or page 138 of the Microsoft FORTRAN "Advanced Topics" manual for version 5.0. The following code example demonstrates this problem.
Sample Code #1C Place the main program and subroutine in the same file C Compile options needed: None
INCLUDE 'FGRAPH.FI' ! interface statements at file beginning PROGRAM GRAPH CALL DUMMY END SUBROUTINE DUMMY() INCLUDE 'FGRAPH.FD' ! declarations within the subroutine CALL clearscreen( $GCLEARSCREEN ) RETURN ENDThe following code example demonstrates the correct method to make graphics calls.
Sample Code #2C Place the main program in a separate file C Compile options needed: None
PROGRAM GRAPH ! No graphics calls in this file, so include CALL DUMMY ! files are not necessary in this file ENDC Place the subroutine into a separate file C Compile options needed: None
INCLUDE 'FGRAPH.FI' ! interface statements at file beginning SUBROUTINE DUMMY() INCLUDE 'FGRAPH.FD' ! declarations within the subroutine CALL clearscreen( $GCLEARSCREEN ) RETURN END |
Additional reference words: 5.00 5.10 L2029
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |