PRB: C1004: Unexpected EOF

Last reviewed: July 17, 1997
Article ID: Q39088
5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a | 1.00 1.50 1.51 1.52
MS-DOS                      | OS/2            | WINDOWS
kbtool kbprb

The information in this article applies to:

  • The Microsoft C/C++ Compiler (CL.EXE) included with:

        - Microsoft C for MS-DOS, versions 5.1, 6.0, 6.0a, and 6.0ax
        - Microsoft C for OS/2, versions 5.1, 6.0, and 6.0a
        - Microsoft C/C++ for MS-DOS, version 7.0
        - Microsoft Visual C/C++ for Windows, versions 1.0, 1.5,
          1.51, 1.52
    

SYMPTOMS

The following error is generated:

   C1004: Unexpected end of file found

CAUSE

The above error may be caused by failing to end a line with a <CR>. On pure C-language statements, the compiler ignores white space; however, on statements with directives, a <CR> is needed.

This error occurs if the following include file is used in a program:

   #include <stdio.h><CR>
   #define YES 1<CR>
   #define NO  0

Without the <CR> after the third line, error C1004 is produced by the compiler.

RESOLUTION

Make sure each line ends with a <CR>.

NOTE: This problem does not occur with any of the 32-bit compilers.


Additional reference words: 1.00 1.50 1.51 1.52 5.10 6.00 6.00a 6.00ax
7.00 8.00
KBCategory: kbtool kbprb
KBSubcategory: CLIss
Keywords : CLIss kb16bitonly kbprb kbtool
Version : 5.10 6.00 6.00a 6.00ax 7.00 | 5.
Platform : MS-DOS OS/2 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.