XCode 4相对#include搜索中的路径? [英] XCode 4 Relative #include paths in search?
问题描述
我试图移植一个项目,我最初写在Windows到OS X和我有一些困难的标题搜索路径。
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.
用户搜索路径以包含源文件夹project / src / core /
在核心下,我有例如:
projects / src / core / sys / sys_sdl.h
尝试包括
projects / src / core / render / opengl_render .h
与指令:
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"
我尝试了大量不同的选项,但我不能得到Xcode找到该文件,除非我将其更改为../ 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"
推荐答案
您尝试设置了用户标题搜索路径 $ SRCROOT /..
? $ SRCROOT是包含目标的源文件的目录,所以$ SRCROOT / ..应该是上面的目录,我认为是你想要的。
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.
问题(如何在Xcode项目中打印构建设置列表?)显示了一个有用的命令容易看到所有的构建设置和他们修改的变量:
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:
$ xcodebuild -project myProj.xcodeproj -target "myTarg" -showBuildSettings
这篇关于XCode 4相对#include搜索中的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!