fatal error C1010: unexpected end of file while looking for precompiled header directive

解决方案 »

  1.   

    头文件有问题!最后加上#endif 试试!
      

  2.   

    要在当前.cpp文件中包含stdafx.h
      

  3.   

    查找预编译头指令时遇到意外的文件结束用 /Yu 指定的包含文件没有列在源文件中。您是否不小心删除了 #include 语句,而该语句引用了 /Yu 所需的 .h 文件?
    #include "stdafx.h"
      

  4.   

    VC project->setting... C/C++页面Category下拉框中选Precompiled Headers
    有几个单选按钮,选中Not using precompiled headers就行了。
    或者在每个.cpp的第一行加上#include "stdafx.h"
    stdafx.h应该是在这个属性页上看到的文件名。
    注意选对工程,rebuild all