请问如何迅速地找到这个编译错误的原因
fatal error C1004: unexpected end of file found

解决方案 »

  1.   

    把你的光标移动到"fatal error C1004:"上面,然后按F1,MSDN会自动定位的.
      

  2.   

    Fatal Error C1004
    unexpected end of file foundThe compiler reached the end of a source file without resolving a construct.For instance, a function or structure definition may be missing a closing curly brace, a class definition may be missing a semicolon after its closing brace, a function call or expression may have mismatched parentheses, and so on.In addition to these common causes, one of the following reasons may have caused this error: The default disk drive did not contain sufficient space for compiler-generated temporary files. The space required is approximately two times the size of the source file.
    An #if directive evaluates to false without a corresponding closing #endif directive.
    The precompiled headers option (/Yu) is enabled but the file doesn't contain a hdrstop pragma.
    The /Yufilename option is used and the source file being compiled does not contain an #include "filename" directive that uses the same filename used with /Yu.
    A source file does not end with a carriage return–linefeed pair. 
    Tips Make sure that each opening brace has a matching closing brace.
    Make sure that each opening parenthesis has a matching closing parenthesis.
    Make sure all class definitions have a semicolon after the closing brace for the class.
    When using C-style comments (i.e. /* ... */), make sure there is a closing asterisk-slash ( */ ) combination. 
      

  3.   

    project setting->c/c++->precompiled headers->Not using precompiled headersyue经帖,maybe ^_^
      

  4.   

    #include "stdafx.h"
    添加在文件的第一句,不行的画就按照楼上方法
      

  5.   

    请问如何迅速地找到这个编译错误的原因
    fatal error C1004: unexpected end of file found
    要解决这个问题很麻烦。
    我在编程中碰到的这个提示有以下情况:
    1、括号不匹配。(经常是在函数中添加了一段代码,如if,while分句,却忘了在结束时补上一个“}”)
    2、在头文件中定义了struct或者class,但是在}之后漏掉了分号。
    3、有#if,但是没有#endif。
    解决办法:
    找出你修改前最后一次能正确运行的源代码。查查看,修改了哪些代码。十有八九是以上的三种情况。
    同意huangbeyond(校园人渣)的意见。