opencv 报错:fatal error C1083: 无法打开包括文件: “stdafx.h”: No such file or directory

来源:互联网 发布:ios看电视直播软件 编辑:程序博客网 时间:2024/04/28 02:03

1、报错

这里写图片描述

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

2、解决办法

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

#include <stdio.h>#include <tchar.h>

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

#include <stdio.h>#include <tchar.h>

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

#include <stdio.h>#include <tchar.h>

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

2 0
原创粉丝点击