尝试找出 Xcode 目录系统
我在尝试编译 box2D 时遇到了一些困难,我认为这是因为我不太了解 Xcode 如何处理其构建目录。
Box2D 是包含一组头文件和源文件(位于各个子目录等)的文件夹。我已将 Box2D 文件夹添加到 Xcode 中的 coco touch 静态库项目中,当我尝试编译时,出现有关未找到头文件的错误,例如
。
我发现,如果我只是将标头包含在 #include "b2BlockAllocator.h"
中,它就能正常编译,并且 Xcode 实际上会找到该文件。
所以我有点卡在这里,我假设我需要找到一种方法来让所有包含内容开始从根项目目录而不是从源文件位置进行搜索,但我不确定如何在Xcode...
有什么想法吗?
I'm a bit stuck trying to get box2D to compile and I think it's because I don't quite understand how Xcode handles its build directories.
Box2D is folder containing a set of header and source files (in various subdirectories, etc). I've added the Box2D folder to a coco touch static library project in Xcode and when I try to compile I get errors about header files not being found such as <Box2D/Common/b2BlockAllocator.h>
.
I found that if I simply include the header with #include "b2BlockAllocator.h"
it compiles fine and Xcode actually finds the file.
So I'm a bit stuck here, I'm assuming I need to find a way to get all includes to begin searching from the root project directory and not from the source files location but I'm not sure how I can do that in Xcode...
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
应位于名为Box2D/Common
的目录中。你说Box2D包含一组头文件和源文件。其中一些标头是否位于Box2D
名为Common
的子目录中,或者它们都直接位于Box2D
下?如果是后者,那就是你的问题了。<Box2D/Common/b2BlockAllocator.h>
should be found in a directory calledBox2D/Common
. You said that Box2D contains a set of header and source files. Are some of these headers in a subdirectory ofBox2D
calledCommon
, or are they all directly underBox2D
? If it's the latter, then that's your problem.好吧,我想通了!
在目标设置页面中查找“标头搜索路径”并将项目的根构建目录添加到其中。
OK I figured it out!
In the targets settings page look for 'header search paths' and add the root build directory of your project to it.