首先创建了一个基于对话框的MFC,名为test,我另外添加了123.cpp和123.h的两个文件。
123.h中定义类,123.cpp中具体解释函数。
在test.cpp和testDlg.cpp中都加入了123.h的头文件。编译时就报错
123.cpp:
fatal error C1010: unexpected end of file while looking for precompiled header directive 
testDlg.cpp:
(大体意思为定义的123类的对象不对)麻烦各位给看看啊
小弟不胜感激!!!!!

解决方案 »

  1.   

    123.cpp中是不是又引用了Testdlg.cpp,这样交叉引用就会出问题的
      

  2.   

    这个就是预编译惹的祸要么 lz 在 123.cpp 里包含 StdAfx.h要么关掉预编译功能
      

  3.   


    我也看了123.cpp文件没有发现什么错误
      

  4.   

    非常感谢!!!
    我在123.cpp中加入了StdAfx.h
    解决了问题1:
    123.cpp:
    fatal error C1010: unexpected end of file while looking for precompiled header directive 但是问题2 依然存在:
    就是在testDlg.cpp中我定义了类123的对象,通过对象调用类中的函数
    出错显示类和对象undeclared identifier,“.函数名”must have class/struct/union type再次求解!!!
    拜托