Xcode找不到#include<>标题 [英] Xcode cannot find #Include<> header
问题描述
我试图让Xcode导入Irrlicht的头文件。
I'm trying to get Xcode to import the header file for Irrlicht.
#include <irrlicht.h>
它说Irrlicht.h。没有这样的文件或目录。是的Irrlicht.h用大写我,即使#include是小写。
It says "Irrlicht.h. No such file or directory". Yes Irrlicht.h with a capital I, even though the #include is lowercase.
无论如何我在标题搜索路径中添加了/lib/irrlicht-1.6/include对于Xcode项目,但它仍然找不到它。
Anyway I added "/lib/irrlicht-1.6/include" in the header search paths for the Xcode project, yet it still doesn't find it.
我尝试的唯一的工作是:
The only thing I've tried that does work is:
#include "/lib/irrlicht-1.6/include/irrlicht.h"
这是有点可笑的,#include应该工作,我不明白为什么它不工作。
This is a bit ridiculous though, #include should work, I don't understand why it isn't working.
更新(这里有关错误的更多详细信息):
Update (here are more details on the error):
/lib/PAL/pal_benchmark/palBenchmark/main.h:31:0
/lib/PAL/pal_benchmark/palBenchmark/main.h:31:22: error: irrlicht.h: No such file or directory
推荐答案
我想出了这一点。
标题位于此目录中:
/lib/irrlicht-1.6/include/
路径:标头搜索路径Xcode在我构建项目时仍然找不到路径。
If I added that path to: "Header Search Paths" Xcode still wouldn't find the path when I built the project.
解决方案:路径:用户标题搜索路径。
它偷窥我为什么我不得不这样做,因为我经常添加我的标题路径到标题搜索路径,然后#includes只是工作。希望这可以帮助有同样问题的其他人。
It boggles me why I had to do this, as I frequently add my header paths to "Header Search Paths" and then #includes just work. Hopefully this can help someone else who gets this same issue.
这篇关于Xcode找不到#include<>标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!