FIX: D2031 Not Generated w/ More Than 121 Files, *.FOR

Last reviewed: September 16, 1997
Article ID: Q86064
5.00 | 5.00 MS-DOS | OS/2 kbtool kbbuglist kbfixlist kberrmsg

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS, version 5.0
  • Microsoft FORTRAN for OS/2, version 5.0

SYMPTOMS

The Microsoft FORTRAN version 5.0 compiler may fail to generate the command-line error

   D2031: Too Many Command-Line Arguments

during pass one of the compiler if more than 121 files are in the current directory and all the files are being compiled using the command line:

   fl *.for

The compiler compiles the first 125 files but after that it stops and generates the message:

   Out Of Memory

It may also generate the command-line error:

   D2013: Too Many Linker Arguments

RESOLUTION

To avoid this problem, the user may create several subdirectories with all the different files divided in small groups (perhaps 100 or less files per directory.)

Alternatively, create an NMAKE file to build the project containing all the files for the final executable. Make sure to create a response file for the linker because it has a limit on the number of arguments you can send on an MS-DOS command line.

STATUS

Microsoft has confirmed this to be a problem in Microsoft FORTRAN version 5.0 for MS-DOS and OS/2. This problem was corrected in Microsoft FORTRAN version 5.1.

MORE INFORMATION

The following program generates 200 FORTRAN source files. After the program is finished, on the directory where it created the FORTRAN files, compile all the files by typing the command:

   FL  *.FOR

Sample Code

This program generates the source files for the test compilation.

      CHARACTER*12 FileName
      CHARACTER*7 tmp
      INTEGER i
      DO 10, i = 1, 200
         WRITE (tmp, '(A4, I3)') 'TEST', i
         IF (i .LT. 10) THEN
           tmp(5:6) = '00'
           FileName = tmp // '.FOR'
         ELSE IF (i .LT. 100) THEN
                tmp(5:5) = '0'
                FileName = tmp // '.FOR'
              ELSE
                FileName = tmp // '.FOR'
         ENDIF
         PRINT *, FileName
         OPEN (1, FILE=FileName)
         WRITE (1, *) '      SUBROUTINE HelloWorld ()'
         WRITE (1, *) '      END'
         CLOSE (1)
 10   CONTINUE
      END


Additional reference words: 5.00 buglist5.00 fixlist5.10
KBCategory: kbtool kbbuglist kbfixlist kberrmsg
KBSubcategory: FLIss
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.