PRB: Build Errors Caused by Incorrect TMP Variable Setting

Last reviewed: July 17, 1997
Article ID: Q102620
1.00 1.50 WINDOWS kbtool kbprb

The information in this article applies to:

  • The Microsoft C/C++ Compiler included with:

        - Microsoft Visual C++ for Windows, versions 1.0 and 1.5
    

SYMPTOMS

An attempt to build an application in Visual C++ version 1.0 fails and one of the following messages appears:

  • If you attempt to build an application in the Visual Workbench or from an MS-DOS prompt in Windows, the Resource Compiler generates a message such as the following:

          Fatal Error C1007: unrecognized flag '\RC23' in 'c1'
          RC: fatal error RW1016: RC terminating after preprocessor errors
    

    -or-

          fatal error C1023: cannot open source file ''
          RC: fatal error RW1016: RC terminating after preprocessor errors
    
  • If you attempt to build an application in MS-DOS when Windows is not running, the results of the NMAKE, CL, or LINK command is similar to the following:

          Phar lap err 58: Can't create VM swap file of size 0 in
    
             directory C:\ \
    
    

CAUSE

The TMP environment variable is not valid. The Resource Compiler creates a RC23 file in the TMP directory to store information between compiler passes. If the TMP environment variable ends with a space, the filename appears to the Resource Compiler as an option switch.

If the TMP environment variable points to a read-only drive, then RC cannot write the temporary file or it cannot read it back which results a C1023 error.

When any of the MS-DOS-extended utilities (such as NMAKE versions 1.3, 1.4, C/C++ versions 8.0, 8.0c, or LINK versions 5.5, 5.6) are invoked from MS-DOS outside Windows, they immediately return with the Phar lap error because the MS-DOS-extender attempts to create a temporary file for virtual memory storage.

RESOLUTION

Verify that the TMP environment variable is valid. It must point to a valid directory on a read-write drive that has enough available free space to store the temporary files.

It may be difficult to detect a trailing space in the TMP environment variable. It is specified in your AUTOEXEC.BAT file with a statement similar to the following:

   SET TMP=C:\TMP

Note that in some text editors, you cannot see a blank space at the end of the line. You must either retype the line or use the END key to go to the end of the line and erase the blank spaces with the BACKSPACE key. If you start Windows from your AUTOEXEC.BAT file, verify that you change the TMP setting before the command that starts Windows.


Additional reference words: 1.00 1.50 1.30 1.40 3.11 5.50 8.00 8.00c DOSXNT
KBCategory: kbtool kbprb
KBSubcategory: CLIss TlsMisc
Keywords : CLIss kb16bitonly TlsMisc kbprb kbtool
Version : 1.00 1.50
Platform : WINDOWS


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: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.