【问题标题】:xcodebuild cannot find header in embedded projectsxcodebuild 在嵌入式项目中找不到标头
【发布时间】:2013-08-10 15:21:47
【问题描述】:

我有一个项目嵌入另一个项目,xcode GUI 构建成功,但在命令行中 xcodebuild 失败。

   fatal error: 'OHAttributedLabel/OHAttributedLabel.h' file not found
   #import <OHAttributedLabel/OHAttributedLabel.h>
           ^
   1 error generated.

但我在项目 HEADER SEARCH PATH(h 所在的位置)中有这个

   ${PROJECT_DIR}/MyProject/Vendor/OHAttributedLabel/Source

问题是header位于“OHAttributedLabel/Source”文件夹中,而import语句在OHAttributedLabel文件夹下寻找header,我不想触碰内嵌项目的目录结构,这里面能做什么案子?

【问题讨论】:

  • 导入OHAttributedLabel/Source/OHAttributedLabel.h

标签: xcode


【解决方案1】:

最好的办法是修改嵌入式项目发布头文件:

  1. 在 xCode 中选择嵌入的项目
  2. 选择适用的目标。
  3. 点击构建阶段
  4. 展开“复制标题”部分并添加 OHAttributedLabel.h 文件。
  5. 选择您的主要项目
  6. 选择适用的目标。
  7. 点击构建阶段。
  8. 单击目标依赖项。
  9. 确保将嵌入式项目添加为依赖项。
  10. 尝试运行应用程序

如果上述方法不起作用,请仔细检查构建阶段的顺序。例如。确保“Target Dependencies”构建阶段在“Compile sources”之前。

【讨论】:

    猜你喜欢
    • 2015-04-16
    • 1970-01-01
    • 2015-04-15
    • 2015-04-18
    • 1970-01-01
    • 1970-01-01
    • 2012-09-20
    • 2011-07-21
    • 1970-01-01
    相关资源
    最近更新 更多