什么会纠正“用户标题搜索路径”针对这种情况(使用第三方库)

发布于 2024-11-01 02:20:42 字数 664 浏览 2 评论 0原文

对于这种情况(使用第 3 方库),正确的“用户标题搜索路径”是什么:

注意:

  • 目录结构:MyApp 目录与 ALibrary 目录处于同一级别。也就是说,我已将第 3 方库的源代码项目不在我的应用程序目录中,但在同一级别
  • 有一个主头文件,它将目录中库中的所有其他头文件汇集在一起​​:“LibraryAppPath/src/核心/标题”。

查询点 - 如果在答案中您可以澄清以下项目(我对此有点困惑),那就太好了,

  1. 我经常看到 $(BUILT_PRODUCTS_DIR) 的用法。 $(BUILT_PRODUCTS_DIR) 实际上解析为什么?即我需要使用哪个目录
  2. “$(BUILT_PRODUCTS_DIR)”作为起点,然后使用多个“../”条目返回到我的应用程序上方的子目录?
  3. 我假设我应该将搜索路径设置到某个地方在库的高处,然后启用“始终搜索用户路径”...这是一个好方法吗?
  4. 我读过目前使用“用户标题搜索路径”可能比使用“标题搜索路径”更好目前正在确保代码完成工作。这可以吗/使用“用户标题搜索路径”有什么负面影响吗?
  5. 有没有一种快速方法可以检查我是否已找到正确的搜索路径?挑选我期望的头文件。
  6. ,主要问题是 - 对于我的情况,什么是正确的“用户头搜索路径”?

当然

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)

  1. I see usage of $(BUILT_PRODUCTS_DIR) a lot. What does $(BUILT_PRODUCTS_DIR) actually resolve to? i.e. which directory
  2. 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?
  3. 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?
  4. 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"?
  5. 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.
  6. Of course the main question is - What would correct "User Header Search Path" be for my scenario.

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

套路撩心 2024-11-08 02:20:42

对于 Xcode 4.x,您可以通过添加自定义构建阶段并将环境添加到构建日志来轻松检查 $(BUILT_PRODUCTS_DIR) 的值。

  1. 转到“目标”和“构建阶段”;
  2. 右下角,点击“Add Build Phase”;
  3. 选择“添加运行脚本”;脚本本身是空的,所以它实际上不会做任何事情;
  4. 确保选中“在构建日志中显示环境变量”选项;
  5. 构建项目

现在,当您检查构建日志时,环境变量都将在那里(如果您展开构建日志阶段的详细信息)。

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.

  1. Go to "Target", and "Build Phases";
  2. Down at the lower right, click "Add Build Phase";
  3. Select "Add Run Script"; the script itself is empty, so it won't actually do anything;
  4. Make sure the "Show environment variable in build log" option is checked;
  5. Build the project

Now, when you check the build log, the environment variables will all be there (if you expand the build log stage's detail).

别把无礼当个性 2024-11-08 02:20:42

注意到 XCode 4 中的构建过程目录现在有所不同,并在 Three20 doco 的帮助下 http://third20.info/article/2011-03-10-Xcode4-Support 我注意到,有效的方法如下。因此我认为这种方法也适用于其他库。

"$(BUILT_PRODUCTS_DIR)/../three20"
"$(BUILT_PRODUCTS_DIR)/../../three20"

如果有的话,请随意发表评论/提供更好的答案。

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.

"$(BUILT_PRODUCTS_DIR)/../three20"
"$(BUILT_PRODUCTS_DIR)/../../three20"

Feel free to comment / supply a better answer if there is one.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文