最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]swift 编译SwiftXMPP出错:Module ‘libxmlSimu’ not found

XMPP crifan 3045浏览 0评论

项目出错:

/Users/crifan/dev/dev_src/swift/SwiftXMPP/git/SwiftXMPP/XMPPFramework/Vendor/KissXML/DDXMLNode.h:6:9: Module ‘libxmlSimu’ not found

如图:

SwiftXMPP XMPPFramework KissXML DDXMLNode.h Module libxmlSimu not found

搜:
swift Module ‘libxmlSimu’ not found
swift Module libxmlSimu not found
参考:
去看看:
xcode build settings search paths
把现有的搜索路径:
existing header search path
改为:
added module search paths
还是不行。
后来看到:
/Users/crifan/dev/dev_src/swift/SwiftXMPP/git/SwiftXMPP/XMPPFramework/module/module.modulemap
中有:
found XMPPFramework module.modulemap
中的内容了:
module libxml [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
export *
}

module libxmlSimu [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/tree.h"
export *
}

module dnssd [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/dns_sd.h"
export *
}

module dnssdSimu [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/dns_sd.h"
export *
}
所以很明显:
想办法,把:
当前项目的根目录的变量找到,加上:
XMPPFramework/module/
即可。
但是看到有3个:
$(PROJECT_DIR)/Pods/XMPPFramework/module
和:
$(PODS_ROOT)/XMPPFramework/module
以及:
$SRCROOT/
所以先去:
搞清楚:
xcode中的系统自带路径变量:PROJECT_DIR,SRCROOT
去添加:
$(inherited) $(SDKROOT)/usr/include/libresolv
$(SDKROOT)/usr/include/libxml2
$(SDKROOT)/XMPPFramework/module
 结果还是不行。
去看了看,对应的文件是有的:
licrifandeMacBook-Pro:libxml crifan$ pwd
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml
licrifandeMacBook-Pro:libxml crifan$ ls -hl tree.h
-rw-r--r--  1 root  wheel    37K 10  3 05:31 tree.h
再去改为:
$(inherited)
/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
$(SRCROOT)/usr/include/libresolv
$(SRCROOT)/usr/include/libxml2
$(SRCROOT)/XMPPFramework/module
heder search include inherited and module path
然后终于解决问题了:
 swiftxmpp project compile ok
点击对应的Xcode项目:
SwiftXMPP-》Build Settings-》Search Paths-》Header Search Paths
添加路径:
$(SRCROOT)/XMPPFramework/module
即可。
其中:
SRCROOT表示Xcode的项目根目录
-》即你的xxx.xcodeproj所在目录
-》比如此处的SwiftXMPP.xcodeproj所在的路径:
/Users/crifan/dev/dev_src/swift/SwiftXMPP/git/SwiftXMPP/
然后对应的:
$(SRCROOT)/XMPPFramework/module
即表示:
/Users/crifan/dev/dev_src/swift/SwiftXMPP/git/SwiftXMPP/XMPPFramework/module
而该路径中有:
module.modulemap
其中有几项是:
module libxml [system] {
    header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
    export *
}

module libxmlSimu [system] {
    header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/tree.h"
    export *
}
很明显,其中的libxmlSimu部分,指明了对应的libxmlSimu路径所在位置。
-》Xcode就会可以通过该路径中搜索和加载到:
libxmlSimu
从而可以继续正常编译了

转载请注明:在路上 » [已解决]swift 编译SwiftXMPP出错:Module ‘libxmlSimu’ not found

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.171 seconds, using 22.12MB memory