+ -
当前位置:首页 → 问答吧 → 无法打开包括文件:“temp.h”: No such file or directory原因

无法打开包括文件:“temp.h”: No such file or directory原因

时间:2011-12-24

来源:互联网

我自己定义了一个temp.h

然后在另一个头文件里#include <temp.h>

然后编译后就报错无法打开包括文件:“temp.h”: No such file or directory

这是什么原因呀,貌似没有什么错误啊?怎么会找不到

作者: jasper3000   发布时间: 2011-12-24

在编译选项中指定include路径。

作者: heartlesstoanyone   发布时间: 2011-12-24

#include "temp.h"

作者: streamlv   发布时间: 2011-12-24

属性页里已经加入了include路径了。不知道什么原因

作者: jasper3000   发布时间: 2011-12-25

用这个也还是不行#include "temp.h"

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

作者: jasper3000   发布时间: 2011-12-25

楼主请搜索#include < >  与  #include " "的区别。

作者: mzlogin   发布时间: 2011-12-25

引用 4 楼 jasper3000 的回复:

用这个也还是不行#include "temp.h"

fatal error C1083: 无法打开包括文件:“temp.h”: No such file or directory
你的两个头文件是在一个文件夹里吗?
如果是的话,#include "temp.h"应该OK了,
不是的话,楼主应该在" "之间提供绝对路径或相对路径,

#include "D:\lib\temp.h" // 绝对路径
#include "..\headers\temp.h" // 相对路径

作者: mzlogin   发布时间: 2011-12-25