• <tfoot id='o7Jg1'></tfoot>

    <small id='o7Jg1'></small><noframes id='o7Jg1'>

      <bdo id='o7Jg1'></bdo><ul id='o7Jg1'></ul>
  • <legend id='o7Jg1'><style id='o7Jg1'><dir id='o7Jg1'><q id='o7Jg1'></q></dir></style></legend>
  • <i id='o7Jg1'><tr id='o7Jg1'><dt id='o7Jg1'><q id='o7Jg1'><span id='o7Jg1'><b id='o7Jg1'><form id='o7Jg1'><ins id='o7Jg1'></ins><ul id='o7Jg1'></ul><sub id='o7Jg1'></sub></form><legend id='o7Jg1'></legend><bdo id='o7Jg1'><pre id='o7Jg1'><center id='o7Jg1'></center></pre></bdo></b><th id='o7Jg1'></th></span></q></dt></tr></i><div id='o7Jg1'><tfoot id='o7Jg1'></tfoot><dl id='o7Jg1'><fieldset id='o7Jg1'></fieldset></dl></div>

      1. 带有 libxml 的 Swift 框架

        时间:2023-05-17
          <tbody id='uOxsD'></tbody>
          <bdo id='uOxsD'></bdo><ul id='uOxsD'></ul>

            <i id='uOxsD'><tr id='uOxsD'><dt id='uOxsD'><q id='uOxsD'><span id='uOxsD'><b id='uOxsD'><form id='uOxsD'><ins id='uOxsD'></ins><ul id='uOxsD'></ul><sub id='uOxsD'></sub></form><legend id='uOxsD'></legend><bdo id='uOxsD'><pre id='uOxsD'><center id='uOxsD'></center></pre></bdo></b><th id='uOxsD'></th></span></q></dt></tr></i><div id='uOxsD'><tfoot id='uOxsD'></tfoot><dl id='uOxsD'><fieldset id='uOxsD'></fieldset></dl></div>
            <legend id='uOxsD'><style id='uOxsD'><dir id='uOxsD'><q id='uOxsD'></q></dir></style></legend>

            1. <tfoot id='uOxsD'></tfoot>

                • <small id='uOxsD'></small><noframes id='uOxsD'>

                • 本文介绍了带有 libxml 的 Swift 框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我有一个使用 KissXML Objective-C 库的 Swift 框架项目.KissXML 在内部使用 libxml.

                  I have Swift Framework project that uses the KissXML Objective-C library. KissXML internally uses libxml.

                  当我构建 xcode 项目(Xcode 6 - beta 5)时,我收到此错误:

                  When I build the xcode project (Xcode 6 - beta 5), I get this error:

                  error: <unknown>:0: error: '/SwiftFramework/SwiftFramework/KissXML/DDXMLNode.h:2: 在框架模块 SwiftFramework.DDXMLNode 中包含非模块化标头

                  我看过这个 answer 讨论公开相关的头文件.我已经这样做了,但我不确定如何解决在 DDXMLNode.h 中导入的此标头的情况,这不是我项目的明确部分:

                  I have seen this answer that discusses making the relevant header files public. I have done that but I am not sure how to address the case of this header that is imported in the DDXMLNode.h and that is not explicitly part of my project:

                  #import <libxml/tree.h>

                  对如何处理有什么建议吗?

                  Any suggestions on how to handle this?

                  注意:我在一个仅限 Objective-C 的项目中使用了 KissXML,它运行良好(Xcode 5).

                  Note: I have used KissXML on a Objective-C only project and it worked fine (Xcode 5).

                  推荐答案

                  诀窍是创建一个模块并将其包含在您的项目中.

                  The trick is to create a module and include it on your project.

                  要创建模块,您需要创建一个名为 module.modulemap 的文件,该文件将 API 导出到感兴趣的头文件中,如下所示:

                  To create the module you create a file named, let's say, module.modulemap which exports the API on the header files of interest like this:

                  module libxmlModuleDevice {
                      header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
                      export *
                  }
                  
                  module libxmlModuleSimulator {
                      header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/tree.h"
                      export *
                  }
                  

                  请注意,您需要为模拟器和实际设备执行此操作 - 因此文件中有 2 个条目.

                  Notice that you need to do this both for the simulator and for the actual device - hence the 2 entries on the file.

                  这个文件module.modulemap可以放在任何地方.我在 Xcode 的项目文件 (.xcodeproj) 的同一级别创建了一个名为 modules 的目录,并将 module.modulemap 文件放在那里.

                  This file module.modulemap can be placed anywhere. I created a directory called modules at the same level as the Xcode's project file (.xcodeproj) and placed the module.modulemap file there.

                  然后将包含此文件的目录添加到 Xcode 项目的 Build Settings 下的 Header Search Path.

                  Then add directory that contains this file to the Header Search Path under Build Settings of you Xcode project.

                  在此示例中,您只需将单词 modules 添加到 Header Search Path,因为 modules 目录位于与 Xcode 项目文件相同的级别.这将在内部更新 Xcode 项目变量 HEADER_SEARCH_PATHS.就是这样.

                  In this example all you have to do is to add the word modules to the Header Search Path because the modules directory is at the same level as the Xcode project file. This will update internally the Xcode project variable HEADER_SEARCH_PATHS. That's it.

                  这篇关于带有 libxml 的 Swift 框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:链接到在应用程序扩展中使用不安全的 dylib 的警告消息 下一篇:TWTweetComposeViewController 中的错误?

                  相关文章

                  • <bdo id='2zlTv'></bdo><ul id='2zlTv'></ul>
                  <tfoot id='2zlTv'></tfoot>
                • <i id='2zlTv'><tr id='2zlTv'><dt id='2zlTv'><q id='2zlTv'><span id='2zlTv'><b id='2zlTv'><form id='2zlTv'><ins id='2zlTv'></ins><ul id='2zlTv'></ul><sub id='2zlTv'></sub></form><legend id='2zlTv'></legend><bdo id='2zlTv'><pre id='2zlTv'><center id='2zlTv'></center></pre></bdo></b><th id='2zlTv'></th></span></q></dt></tr></i><div id='2zlTv'><tfoot id='2zlTv'></tfoot><dl id='2zlTv'><fieldset id='2zlTv'></fieldset></dl></div>

                    <small id='2zlTv'></small><noframes id='2zlTv'>

                    1. <legend id='2zlTv'><style id='2zlTv'><dir id='2zlTv'><q id='2zlTv'></q></dir></style></legend>