User Header Search Paths for Xcode
I have two paths that I want Xcode to search for headers:
"/myproject/lib1/include"
"/myproject/lib2/include"
What's the correct syntax for adding those two paths inside Xcode's User Header Search Paths? I tried "/myproject/lib1/include";"/myproject/lib2/include"
But it didn't work. It complained that object1.h not found. object1 is inside /myproject/lib1/include
I already added the whole /myproject/lib1/include folder and /myproject/lib2/include folder into the target project.
Dd you actually put the leading /into the path? Because that's an absolute path and probably not what you mean.
You can pass it the relative location using $(SRCROOT)
which expands the the directory containing the Xcode project file.
So, assuming your project file is in the myroject
directory you should put this in your header search paths:
$(SRCROOT)/lib1/include
$(SRCROOT)/lib2/include
Suppose you want to use your project directory, then you should use:
"$PROJECT_DIR"
Double quotes are advised if your project path has spaces.
Enable recursive if you want to search within the folders as well. Alternatively, you can use "$(SRCROOT)"
If you have multiple header paths, use SPACE to divide them, or double click the input text box of header pathS for advance setting. Another recommended way is search "User Header Search Paths" in your Xcode help menu.
链接地址: http://www.djcxy.com/p/42634.html上一篇: XCode 5中的标题搜索路径的相对路径文件夹问题
下一篇: Xcode的用户头部搜索路径