【问题标题】:Declaration of 'xmlKeepBlanksDefault' must be imported from module 'libxml2.parser' before it is required必须先从模块“libxml2.parser”导入“xmlKeepBlanksDefault”声明
【发布时间】:2018-07-08 04:04:50
【问题描述】:

当我尝试使用 Xcode 9.3 beta 编译和运行我现有的应用程序时,它给了我类似的错误

Declaration of 'xmlKeepBlanksDefault' must be imported from module 'libxml2.parser' before it is required

Implicit declaration of function 'xmlKeepBlanksDefault' is invalid in C99

它在KissXML 库的文件DDXMLDocument.m 中。 Issue 已经提出来了

有人可以帮忙吗?

【问题讨论】:

  • 用新的github.com/robbiehanson/KissXML/issues/95 替换旧的 KissXML 文件夹,问题已解决。感谢 cahn 提供的网址。
  • 我刚刚从最新的 KissXML 更新了“DDXMLDocument”类。它对我有用。

标签: ios xcode9.3-beta


【解决方案1】:

以上答案对我有用,不过我手动更新了它。

1.Remove existing KissXML from project select move to thrash 不是通过删除引用。

2.从上面答案中提供的github链接下载zip并提取。

  1. 将 KissXML 目录拖放到要添加的项目中,如果需要,选择复制,然后选择创建组。

  2. 右键单击导入的目录并选择在finder中显示,在目录中检查所有内容都已复制并在项目中显示相同。

这应该可以解决问题。

【讨论】:

    【解决方案2】:

    通过运行 pod update KissXML 更新 KissXML

    详情请见https://github.com/robbiehanson/KissXML/issues/95

    【讨论】:

    • 这对我不起作用。我收到相同(或非常相似)的错误消息。 “函数 'xmlKeepBlanksDefault' 的隐式声明在 C99 中无效”,“xmlParseMemory”也是如此,并且必须从 libxml2.parser 导入它们才需要它们的错误。更新似乎更新它,但问题仍然存在。 Xcode 9.3,KissXML 5.1.2,通过带有 pod 'KissXML/SwiftNSXM' 的 POD 文件安装
    • @narco 您可能使用的是旧版本。当前的 5.2.2 pod 规范没有任何子规范。
    • 如果我将 podfile 更改为 pod 'KissXML'(我不记得为什么我最初有 'KissXML/SwiftNSXM'),那么它会更新到 5.2.2 并消除此错误,但是给出一个新错误:“ld: library not found for -lPods-MyApp clang: error: linker command failed with exit code 1 (use -v to see invocation)”。我希望这是一个改进,但我同样难过;)
    • @narco 然后我假设编译成功但链接无法找到 pod 框架。那是另一个故事。我认为您应该搜索答案或提出一个新问题。
    猜你喜欢
    • 2016-12-26
    • 2016-04-23
    • 2022-09-26
    • 2019-12-05
    • 2023-02-15
    • 2014-07-10
    • 2021-11-04
    • 2013-12-04
    • 1970-01-01
    相关资源
    最近更新 更多