编译时候出错:
Cannot open include file: 'stdafx.h': No such file or directory
如何处理???

解决方案 »

  1.   

    设有这个文件,看一看有没有把Include的目录改过,它在tools menu下的options里可以找到
      

  2.   

    Ask for a new workspace.  Ask for a new workspace type of "Console".
    Include <afx.h> and <afxwin.h> and whatever else you need.  Use
    the "Project Settings" dialog to say how you want to link to MFC.
    Add an instance of CWinApp or a CWinApp-derived object to your
    application.  Correctly initialize MFC
      

  3.   

    啊,看来是非常新的新手了。stdafx.h是系统创建一个工程时自动为你生成的一个头文件,里面包含了一些常用的头文件,没有它也吓不死人的,删掉就好。然后自己根据需要添加合适的头文件就可以了,也可以重新创建一个空的console程序,然后将它的stdafx.h拷贝过来。
      

  4.   

    to  protale() 
         好象不是那么简单吧   我也把stdafx.h文件给删除了    但无论如果都不能通过 
    我是创建了一个空的项目  也就是里面什么都没有
      

  5.   

    看看你VC->Project->Setting->C++  -->Precompiled Header里面的设置,
    选中Use precompiled header file(.pch)
    Through header: stdafx.h
      

  6.   

    你的是console?
    那就Automatic use of precompiled header
      

  7.   

    都说什么呢??
    Cannot open include file: 'stdafx.h': No such file or directory你创建工程的时候, 不要选 Empty, 就有'stdafx.h'了, 在哪, 你工程的目录下.你要是自己Include, 路径就不是工程的目录下了.