XCode 4 搜索中的相对 #include 路径?
我正在尝试将我最初在 Windows 中编写的项目移植到 OS X,但在标头搜索路径方面遇到了一些困难。
我已使用用户搜索路径来包含源文件夹“project/src/core/”
在核心下,我有,例如: “projects/src/core/sys/sys_sdl.h”
它试图包括 “projects/src/core/render/opengl_render.h”
使用指令:
#include "render/opengl_render.h"
我尝试了很多不同的选项,但我似乎无法让 Xcode 找到该文件,除非我将其更改为 "../render/opengl_render.h"
是我在设置中缺少一些东西来让它识别标题搜索路径的相对路径?
I'm trying to port over a project I initially wrote in Windows to OS X and am having some difficulty with the header search paths.
I've used user search paths to include by source folder "project/src/core/"
Under core, I have, for example:"projects/src/core/sys/sys_sdl.h"
which tries to include"projects/src/core/render/opengl_render.h"
with the directive:
#include "render/opengl_render.h"
I've tried tons of different options, but I can't get seem to get Xcode to find the file unless I change it to "../render/opengl_render.h"
Is there something I'm missing here in the settings to get it to recognize relative paths to the header search paths?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试将用户标头搜索路径设置为
$SRCROOT/..
? $SRCROOT 是包含目标源文件的目录,因此 $SRCROOT/.. 应该是其上方的目录,我认为这就是您想要的。相关问题(How do I print a list of "Build Settings" in Xcode project?)显示了一个有用的命令,可以使很容易查看所有构建设置及其修改的变量:
Did you try setting the User Header Search Path to
$SRCROOT/..
? $SRCROOT is the directory that contains the target's source files, so $SRCROOT/.. should be the directory above that, which I think is what you want.A related question (How do I print a list of "Build Settings" in Xcode project?) shows a useful command that makes it easy to see all the build settings and the variables they modify: