Microsoft KB Archive/39088: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - "<" to "<")
Line 37: Line 37:
== CAUSE ==
== CAUSE ==


The above error may be caused by failing to end a line with a &lt;CR&gt;. On pure C-language statements, the compiler ignores white space; however, on statements with directives, a &lt;CR&gt; is needed.<br />
The above error may be caused by failing to end a line with a <CR&gt;. On pure C-language statements, the compiler ignores white space; however, on statements with directives, a <CR&gt; is needed.<br />
<br />
<br />
This error occurs if the following include file is used in a program:
This error occurs if the following include file is used in a program:


<pre class="CODESAMP">  #include &lt;stdio.h&gt;&lt;CR&gt;
<pre class="CODESAMP">  #include <stdio.h&gt;<CR&gt;
   #define YES 1&lt;CR&gt;
   #define YES 1<CR&gt;
   #define NO  0 </pre>
   #define NO  0 </pre>
Without the &lt;CR&gt; after the third line, error C1004 is produced by the compiler.
Without the <CR&gt; after the third line, error C1004 is produced by the compiler.


<br />
<br />
Line 51: Line 51:
== RESOLUTION ==
== RESOLUTION ==


Make sure each line ends with a &lt;CR&gt;.<br />
Make sure each line ends with a <CR&gt;.<br />
<br />
<br />
'''NOTE''': This problem does not occur with any of the 32-bit compilers.
'''NOTE''': This problem does not occur with any of the 32-bit compilers.

Revision as of 09:26, 21 July 2020

PRB: C1004: Unexpected EOF

Q39088



The information in this article applies to:


  • The C/C++ Compiler (CL.EXE), included with:
    • Microsoft C/C++ for MS-DOS, versions 5.1, 6.0, 6.0a, 6.0ax, 7.0
    • Microsoft Visual C++, versions 1.0, 1.5, 1.51'1.52
    • Microsoft C for OS/2





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 query words: 1.00 1.50 1.51 1.52 5.10 6.00 6.00a 6.00ax 7.00 8.00

Keywords : kb16bitonly kbCompiler kbprb
Issue type : kbprb
Technology : kbVCsearch kbAudDeveloper kbCVCComp


Last Reviewed: May 8, 2001
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.