'libxml/tree.h' file not found 库文件没有被找到

来源:互联网 发布:重庆行知职业技术学校 编辑:程序博客网 时间:2024/06/01 09:47

(打开第三方项目时,会遇到)项目中用到某个库文件 没有被找到  

/Users/heyy/Desktop/ZhaoPin_V1.1-master/ZhaoPin_V1/Resource/GDataXMLNode.h:38:9: fatal error: 'libxml/tree.h' file not found

#import <libxml/tree.h>

原因:这是因为类库没有链接进来的原因。

1 . 导入类库:libxml2.2 【后缀看情况】

虽然导入但是需要再进行链接才行

2 . 在Build Settings 中搜索Header Search Paths :设置如下: 
$(SDKROOT)/usr/include/libxml2 编译即可成功

 

该库没有加入到项目中  到 framework 中找到该库添加进来 。有时会遇到 在当前系统下搜索不到该库 这是就要自己手动添加 

步骤如下:

今天开始介入苹果越狱sdk,说明文档中需要加入类库libxml2.dylib。

我用的xcode版本为7.1且ios sdk版本为9.1,发现在添加链接库时找不到某些类库。例如:libxml3.dylib 已经变成了libxml2.tbd。

google后找到如下方法:

had the same problem. I found some kind of way around.

  1. Go to Build Phases >Link Binary with Librairies > + > Add other
  2. Once in the file selection window do "CMD"+Shift+G (Go to folder) and type /usr/lib/
  3. From /user/lib you can add : libz.dylib and more...
  4. Compile and have fun
意思是说libxml2.dylib还在,只是需要手动添加,地址在/usr/lib目录下。
顺便说一下, tbd文件可以减少app大小所以建议使用,但接sdk么,还得看人家用的是什么。

0 0
原创粉丝点击