开发者

XCode 4 Relative #include paths in search?

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/" 开发者_如何学CUnder 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?


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:

$ xcodebuild -project myProj.xcodeproj -target "myTarg" -showBuildSettings
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜