The information in this article applies to:
SYMPTOMSMixed-language C and FORTRAN Windows applications may appear to fail to start when executed or, under CodeView for Windows, may immediately exit with the Program Terminated Normally message on the first step into the application. CAUSE
The FORTRAN code may have an additional END statement following the
subroutine or function declaration. An additional END statement is
interpreted by the compiler as an empty main program declaration,
and thus causes the insertion of the entry point _main.
Because the FORTRAN code declared a _main function that does nothing, the main window of the program is not created and the application exits immediately after it starts. This problem is more common with mixed-language C and FORTRAN Windows applications. RESOLUTIONCheck all FORTRAN code for extra END statements and remove them. STATUSThis functionality is by design. Windows applications should have only WinMain() functions as entry points. The problem is caused by the interpretation that standard FORTRAN syntax gives to an extra END statement. MORE INFORMATIONWith non-Windows applications, an extra END statement causes the linker to generate the following error: Windows applications do not have an _main function, however, so no linker error is generated. To duplicate this problem, use the MULMIX project example that comes with FORTRAN 5.1 and add an additional END statement below the MUL subroutine in the MULF.FOR file. For more information, query on the following words in the Microsoft Knowledge Base: winmain main qwin100 Additional query words: nofps 5.10
Keywords : |
Last Reviewed: November 5, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |