“stdafx.h”: No such file or directory

1、报错

“stdafx.h”: No such file or directory_第1张图片

这里的错误是,你包含了头文件 #include “stdafx.h” 产生所产生的,大概你是创建的空项目,却包含了这个头文件。

2、解决办法

办法一 
将头文件替换掉(建议此种做法,较简单);查看 “stdafx.h” 所包含的内容为:

#include 
#include 
  • 1
  • 2
  • 1
  • 2

这里只需将你的 ,#include “stdafx.h” 删除掉。更换为 其所包含的内容。也就是:

#include 
#include 
  • 1
  • 2
  • 1
  • 2

办法二: 
在你项目中,找到头文件,添加头文件,名为:stdafx.h :添加成功后,单击并添加内容:

#include 
#include 
  • 1
  • 2
  • 1
  • 2

保存,再行编译,错误解决~

你可能感兴趣的:(OpenCV,图像处理,VS2012,开发,OpenCV)