Xcode:将项目添加为构建依赖项

时间:2021-05-05 22:48:37

Im playing around with the soundcloud api, in its instructions it says to

我正在摆弄soundcloud api,在它的指令中

  • drag SoundCloudAPI.xcodeproj into your project
  • 拖SoundCloudAPI。xcodeproj到您的项目
  • add it as a build dependency
  • 将其添加为构建依赖项

I can drag the project in pretty easily, but how does one accomplish the next step?

我可以很容易地拖拽项目,但是如何完成下一步呢?

4 个解决方案

#1


28  

To add it as a dependency do the following:

要将其添加为依赖项,请执行以下操作:

  • Highlight the added project in your file explorer within xcode. In the directory browser window to the right it should show a file with a .a extension. There is a checkbox under the target column (target icon), check it.
  • 在xcode中突出显示添加的项目。在右边的目录浏览器窗口中,它应该显示一个扩展名为.a的文件。在目标列(目标图标)下面有一个复选框,请选中它。
  • Right-Click on your Target (under the targets item in the file explorer) and choose Get Info
  • 右键单击您的目标(在文件资源管理器中的目标项下)并选择获取信息
  • On the general tab is a Direct Dependencies section. Hit the plus button
  • 在general选项卡上是一个直接依赖项部分。点击+按钮
  • Choose the project and click Add Target
  • 选择项目并单击Add Target。

#2


11  

  1. Select your project in the navigator on left.
  2. 在左侧的导航器中选择您的项目。
  3. Open up the drawer in the middle pane and select your target.
  4. 打开中间窗格中的抽屉,选择目标。
  5. Select Build Phases
  6. 选择构建阶段
  7. Target Dependencies is an option at that point.
  8. 此时,目标依赖项是一个选项。

#3


4  

Under TARGETS in your project, right-click on your project target (should be the same name as your project) and choose GET INFO, then on GENERAL tab you will see DIRECT DEPENDENCIES, simply click the [+] and select SoundCloudAPI.

在项目目标下,右键单击项目目标(应该与项目同名)并选择GET INFO,然后在GENERAL选项卡上您将看到直接依赖项,只需单击[+]并选择SoundCloudAPI。

#4


0  

Today I faced with the same problem. As the result of the first run I got next error:

今天我遇到了同样的问题。由于第一次运行的结果,我得到了下一个错误:

Lexical or Preprocessor Issue: 'SDKProjectName*/*SDKProjectName.h' file not found.

词汇或预处理问题:'SDKProjectName*/*SDKProjectName。h的文件未找到。

But before running, I, obviously, added my SDK into the demo project, just drag&drop .xcodeproj file into my test project's source tree. After that, I moved into Build Phases tab in setting of the main xcodeproj file (of the demo) and added my SDK as target dependency and embed framework into corresponding tabs.

但是在运行之前,我显然将SDK添加到演示项目中,只是将.xcodeproj文件拖放到测试项目的源代码树中。之后,我进入Build phase选项卡,设置主xcodeproj文件(demo)),并添加了SDK作为目标依赖项,并将框架嵌入到相应的选项卡中。

But at the result, I got an error above!

但结果是,我上面有个错误!

So, the problem was into empty line on the Header Search Paths option. I just wrote "../**" as value for this key and project compiled successfully. So, after that, you can add #include <SDKName/SDKName.h> into any project, which includes this SDK.

因此,问题出现在标题搜索路径选项的空行中。我只是写了”……/**"作为本密钥的值,已成功编译。因此,在此之后,您可以添加#include 进入任何项目,包括这个SDK。

ps. My test app was created into root SDK folder.

我的测试应用程序被创建为根SDK文件夹。

#1


28  

To add it as a dependency do the following:

要将其添加为依赖项,请执行以下操作:

  • Highlight the added project in your file explorer within xcode. In the directory browser window to the right it should show a file with a .a extension. There is a checkbox under the target column (target icon), check it.
  • 在xcode中突出显示添加的项目。在右边的目录浏览器窗口中,它应该显示一个扩展名为.a的文件。在目标列(目标图标)下面有一个复选框,请选中它。
  • Right-Click on your Target (under the targets item in the file explorer) and choose Get Info
  • 右键单击您的目标(在文件资源管理器中的目标项下)并选择获取信息
  • On the general tab is a Direct Dependencies section. Hit the plus button
  • 在general选项卡上是一个直接依赖项部分。点击+按钮
  • Choose the project and click Add Target
  • 选择项目并单击Add Target。

#2


11  

  1. Select your project in the navigator on left.
  2. 在左侧的导航器中选择您的项目。
  3. Open up the drawer in the middle pane and select your target.
  4. 打开中间窗格中的抽屉,选择目标。
  5. Select Build Phases
  6. 选择构建阶段
  7. Target Dependencies is an option at that point.
  8. 此时,目标依赖项是一个选项。

#3


4  

Under TARGETS in your project, right-click on your project target (should be the same name as your project) and choose GET INFO, then on GENERAL tab you will see DIRECT DEPENDENCIES, simply click the [+] and select SoundCloudAPI.

在项目目标下,右键单击项目目标(应该与项目同名)并选择GET INFO,然后在GENERAL选项卡上您将看到直接依赖项,只需单击[+]并选择SoundCloudAPI。

#4


0  

Today I faced with the same problem. As the result of the first run I got next error:

今天我遇到了同样的问题。由于第一次运行的结果,我得到了下一个错误:

Lexical or Preprocessor Issue: 'SDKProjectName*/*SDKProjectName.h' file not found.

词汇或预处理问题:'SDKProjectName*/*SDKProjectName。h的文件未找到。

But before running, I, obviously, added my SDK into the demo project, just drag&drop .xcodeproj file into my test project's source tree. After that, I moved into Build Phases tab in setting of the main xcodeproj file (of the demo) and added my SDK as target dependency and embed framework into corresponding tabs.

但是在运行之前,我显然将SDK添加到演示项目中,只是将.xcodeproj文件拖放到测试项目的源代码树中。之后,我进入Build phase选项卡,设置主xcodeproj文件(demo)),并添加了SDK作为目标依赖项,并将框架嵌入到相应的选项卡中。

But at the result, I got an error above!

但结果是,我上面有个错误!

So, the problem was into empty line on the Header Search Paths option. I just wrote "../**" as value for this key and project compiled successfully. So, after that, you can add #include <SDKName/SDKName.h> into any project, which includes this SDK.

因此,问题出现在标题搜索路径选项的空行中。我只是写了”……/**"作为本密钥的值,已成功编译。因此,在此之后,您可以添加#include 进入任何项目,包括这个SDK。

ps. My test app was created into root SDK folder.

我的测试应用程序被创建为根SDK文件夹。