#include "Stdafx.h"
或去掉预编译

解决方案 »

  1.   

    检查一下你工程中的所有文件是否都有头文件的宏定义,一般格式是在头文件中加上宏定义,然后再在实现文件中包括头文件。
    头文件
    #ifndef _FILE_H
    #define _FILE_H
    文件声明体
    #endif
    实现文件
    #include .h
      

  2.   

    检查条件编译语句,带井号的那些 如
    #ifdef xxx
    看看是不是没有#endif呀
      

  3.   

    添加到*.cpp#include "stdafx.h"#ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif
      

  4.   

    把project setting->C/C++ ->Precompiled Headers設置為Automatic use of precompiled headers,Through Header設置為stdafx.h,然后重新編譯