e:\winapi\test5\jd.cpp(28) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.
编译的时候出现上述错误。我是用VC60用AppWizard下建了一个MFC exe的工程。
然后在这个工程里加入了两个文件:jd.h和jd.cpp,然后在编译的时候出现了上述错误。可是我建立一个Console工程时,加入jd.h和jd.cpp编译通过的啊

解决方案 »

  1.   

    在CPP文件中加入:
    #include "stdafx.h"
    试试看。
      

  2.   

    你的jd.cpp,jd.h是什么样的文件? 一个类? 还是其它的什么东东? 如果你的jd文件就是你的一个完整的程序,那么如果你生成了MFC exe后,你到底想让你的工程使用哪个函数入口呢?
      

  3.   

    在cpp文件的开头加上#include "stdafx.h"
      

  4.   

    加上#include "stdafx.h"
    或者去掉预编译头。
      

  5.   

    大家说的没错,加上#include "stdafx.h"就好了。不知其原因是什么啊,为什么要加上这一句啊
    ,请教各位?
      

  6.   

    要和mfc关联上就要加上#include "stdafx.h"