我已经将SpatialIite合并到一个Xcode项目中,该项目使用了来自projproject .4的头文件,只有一个头文件。两者都是Xcode项目,都有静态目标。

我试图从git子模块迁移到Cocoapods。由于静态目标似乎很难与Cocoapods一起使用,我只想以通常的方式构建项目。我为项目4做了podspec。在为SpatialLite编写podfile后,我得到了警告:

[!] The target `SpatialiteIOS [Debug]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The target `SpatialiteIOS [Debug]` overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The target `SpatialiteIOS [Debug - Release]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The target `SpatialiteIOS [Debug - Release]` overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

我读了这个问题,但我对警告是什么意思以及我能做些什么来解决它一无所知。

另外一个问题是,当我单独打开工作区以及打开SpatiaLite项目时,两者都是针对Mac OSX 64的,而它应该是一个iOS项目。我的播客文件上写着“平台:ios”。


当前回答

如果Xcode在链接时报错,例如Library not found for -lPods,它不会检测隐式依赖:

进入“产品>编辑方案” 点击构建 添加Pods静态库 清理并重新建造

其他回答

Xcode截图

Ankish Jain给出了对我有用的答案。这里是要做什么的截图,因为我花了一点时间来找出到底要做什么。

在我的情况下,我需要添加$(继承)到我的“其他链接器标志”,因为这是什么显示为覆盖终端。

如果Xcode在链接时报错,例如Library not found for -lPods,它不会检测隐式依赖:

进入“产品>编辑方案” 点击构建 添加Pods静态库 清理并重新建造

下面的第一行链接拯救了我:

要向项目构建设置中的选项添加值,请在值列表前面加上$(inherited)。

https://github.com/CocoaPods/CocoaPods/wiki/Creating-a-project-that-uses-CocoaPods#faq

另外,不要忘记在pod文件的开头插入这一行:

platform :iOS, '5.0'

我在终端中看到了这3个pod命令错误

pod install

[!MY_APP [Debug/Release]目标覆盖 HEADER_SEARCH_PATHS…… [!MY_APP [Debug/Release]目标 覆盖OTHER_LDFLAGS… [!MY_APP [Debug/Release]目标 重写GCC_PREPROCESSOR_DEFINITIONS…

添加$(inherited)到,这3个错误都会消失

页眉搜索路径 其他链接标志 预处理器宏

在Project -> Target -> Build Settings中

现在该命令将运行而不会出现任何错误

pod install

这在大多数情况下都是有效的:

转到你的目标构建设置->其他链接标志->双击。将$(inherited)添加到新行。

如果你对“…目标覆盖GCC_PREPROCESSOR_DEFINITIONS构建设置定义在…"然后你必须添加$(继承)到你的目标构建设置->预处理器宏