什么会纠正“用户标题搜索路径”针对这种情况(使用第三方库)
对于这种情况(使用第 3 方库),正确的“用户标题搜索路径”是什么:
注意:
- 目录结构:MyApp 目录与 ALibrary 目录处于同一级别。也就是说,我已将第 3 方库的源代码项目不在我的应用程序目录中,但在同一级别
- 有一个主头文件,它将目录中库中的所有其他头文件汇集在一起:“LibraryAppPath/src/核心/标题”。
查询点 - 如果在答案中您可以澄清以下项目(我对此有点困惑),那就太好了,
- 我经常看到 $(BUILT_PRODUCTS_DIR) 的用法。 $(BUILT_PRODUCTS_DIR) 实际上解析为什么?即我需要使用哪个目录
- “$(BUILT_PRODUCTS_DIR)”作为起点,然后使用多个“../”条目返回到我的应用程序上方的子目录?
- 我假设我应该将搜索路径设置到某个地方在库的高处,然后启用“始终搜索用户路径”...这是一个好方法吗?
- 我读过目前使用“用户标题搜索路径”可能比使用“标题搜索路径”更好目前正在确保代码完成工作。这可以吗/使用“用户标题搜索路径”有什么负面影响吗?
- 有没有一种快速方法可以检查我是否已找到正确的搜索路径?挑选我期望的头文件。
- ,主要问题是 - 对于我的情况,什么是正确的“用户头搜索路径”?
当然
What would correct "User Header Search Path" be for this scenario (use of 3rd party library):
Notes:
- directory structure: MyApp directory is at same level as the ALibrary directory. That is I've put the source code project for the 3rd party library not within my app directory, but at the same level
- there is one main header file which brings together all other headers from the library in the directory: "LibraryAppPath/src/core/headers".
Query Points - would be good if in the answer you could clarify the following items (which I'm a bit confused about)
- I see usage of $(BUILT_PRODUCTS_DIR) a lot. What does $(BUILT_PRODUCTS_DIR) actually resolve to? i.e. which directory
- do I need to use "$(BUILT_PRODUCTS_DIR)” as a starting point and then use multiple "../" entries to back out to a subdirectory above my app?
- I was assuming I should probably set a search path to somewhere high up in the library and then enable "Always Search User Paths"...would this be a good way to go?
- I have read using "User Header Search Path" currently may be better than using "Header Search Paths" as the former is currently ensuring code completion works. Is this ok / are there any negatives to using "User Header Search Path"?
- Is there a quick way to check in XCode that I've got the right search path in place? A way to tell it's picking up the header files I expect.
- Of course the main question is - What would correct "User Header Search Path" be for my scenario.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 Xcode 4.x,您可以通过添加自定义构建阶段并将环境添加到构建日志来轻松检查
$(BUILT_PRODUCTS_DIR)
的值。现在,当您检查构建日志时,环境变量都将在那里(如果您展开构建日志阶段的详细信息)。
For Xcode 4.x, you can check the value of
$(BUILT_PRODUCTS_DIR)
easily by adding a custom build phase and having it add the environments to the build log.Now, when you check the build log, the environment variables will all be there (if you expand the build log stage's detail).
注意到 XCode 4 中的构建过程目录现在有所不同,并在 Three20 doco 的帮助下 http://third20.info/article/2011-03-10-Xcode4-Support 我注意到,有效的方法如下。因此我认为这种方法也适用于其他库。
如果有的话,请随意发表评论/提供更好的答案。
After noting that the build process directories are different now in XCode 4, and with help from the three20 doco at http://three20.info/article/2011-03-10-Xcode4-Support I have noted that what has worked is as follows. Hence I assume this approach would work for other libraries.
Feel free to comment / supply a better answer if there is one.