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

[已解决]Xcode中Swift项目中导入XMPPFramework编译出错:libxml xmlversion.h file not found

Swift crifan 3010浏览 0评论
问题:
之前已经解决了:
[已解决]swift 编译SwiftXMPP出错:Module ‘libxmlSimu’ not found
之前的SwiftXMPP演示项目中的libxmlSimu问题
现在,把SwiftXMPP中的,可以正常工作的XMPPFramework导入到当前项目中,然后再去编译,结果出错:
XMPPFramework/Vendor/KissXML/DDXMLNode.h
中的:
#import <Foundation/Foundation.h>

#if !(TARGET_IPHONE_SIMULATOR)
@import libxml;
#else
@import libxmlSimu;
#endif

@class DDXMLDocument;
编译出错:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/tree.h:17:10: ‘libxml/xmlversion.h’ file not found
如图:
libxml xmlversion.h file not found
搜:
Xcode iPhoneSimulator.sdk tree.h:17:10: ‘libxml/xmlversion.h’ file not found
注意到,此处的Target是iOS 9.1:
here xcode target ios 9.1
而之前的项目的Target是iOS 7:
previous target ios 7
不知道是不是:
iOS 9.1中的模拟器,没有iOS 7中的模拟器中的头文件?
参考:
搜:
Xcode  ‘libxml/xmlversion.h’ file not found
参考:
去试试:
PROJECT-》Building Settings-》Search Paths-》Header Search Paths
从:
$(SRCROOT)/usr/include/libxml2
$(SRCROOT)/usr/include/libresolv
修改为:
/usr/include/libxml2
/usr/include/libresolv
change to usr include libresolv
看看效果。
然后终于编译成功了:
xcode project build succeeded
[总结]
此处,编译Xcode项目出错找不到:
‘libxml/xmlversion.h’ file not found
原因是:
没有加入正确的搜索路径
所以去:
Xcode项目属性-》PROJECT-》Building Settings-》Search Paths-》Header Search Paths
加上:
/usr/include/libxml2
/usr/include/libresolv
注意:
记得加上:
$(inherited)
这样会使得:
在PROJECT中设置的路径,
set PROJECT inherited
可以自动继承到TARGET中的设置:
affect to parent settings for path
-》这样TARGET中的搜索路径,也就都有了,都正确了,可以正常编译生成app程序了。

转载请注明:在路上 » [已解决]Xcode中Swift项目中导入XMPPFramework编译出错:libxml xmlversion.h file not found

发表我的评论
取消评论

表情

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

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
86 queries in 0.186 seconds, using 22.10MB memory