解决libxml/tree.h not found问题

本文详细介绍了如何在iOS开发环境中正确地添加libxml库,包括通过Xcode进行链接库的步骤、查找SDK_DIR绝对路径的方法及配置HeaderSearchPaths的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.targets->Build Phases->Link Binary With Libraries点击加号
[img]http://dl.iteye.com/upload/attachment/0080/0595/8a843856-a6f4-3e7a-8035-0e2c1e12ff7a.png[/img]
2.输入libxml,添加libxml.dylib
[img]http://dl.iteye.com/upload/attachment/0080/0598/7509c355-4401-3b22-a536-b7a66d2944be.png[/img]
3.点击Show in Finder
[img]http://dl.iteye.com/upload/attachment/0080/0601/c16f0392-c43a-3747-aa03-a6cf639bfc16.png[/img]
4,右键点击显示简介,找到SDK_DIR绝对路径
[img]http://dl.iteye.com/upload/attachment/0080/0603/3f16a9b1-229f-3606-8374-7cd3680800bb.png[/img]
5,在终端输入命令:sudo ln -s /Volumes/Apple\ Xcode\ 4.6/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/libxml2/libxml /usr/include/libxml
6,修改Header Search Pahts
[img]http://dl.iteye.com/upload/attachment/0080/0605/d474c104-63a4-3f5b-95b3-529dd1199ca8.png[/img]
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libtext-unidecode-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl tex-common Suggested packages: libxml-sax-expatxs-perl debhelper texlive-base texlive-latex-base texlive-plain-generic texlive-fonts-recommended The following NEW packages will be installed: libtext-unidecode-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl tex-common texinfo 0 upgraded, 8 newly installed, 0 to remove and 370 not upgraded. Need to get 2,426 kB of archives. After this operation, 15.1 MB of additional disk space will be used. Do you want to continue? [Y/n] y Err:1 http://http.kali.org/kali kali-rolling/main amd64 tex-common all 6.17 404 Not Found [IP: 54.39.128.230 80] Err:2 http://http.kali.org/kali kali-rolling/main amd64 libtext-unidecode-perl all 1.30-1 404 Not Found [IP: 54.39.128.230 80] Err:3 http://http.kali.org/kali kali-rolling/main amd64 libxml-namespacesupport-perl all 1.12-1.1 404 Not Found [IP: 54.39.128.230 80] Err:4 http://http.kali.org/kali kali-rolling/main amd64 libxml-sax-base-perl all 1.09-1.1 404 Not Found [IP: 54.39.128.230 80] Err:5 http://http.kali.org/kali kali-rolling/main amd64 libxml-sax-perl all 1.02+dfsg-3 404 Not Found [IP: 54.39.128.230 80] Err:6 http://http.kali.org/kali kali-rolling/main amd64 libxml-libxml-perl amd64 2.0134+dfsg-2+b1 404 Not Found [IP: 54.39.128.230 80] Err:7 http://http.kali.org/kali kali-rolling/main amd64 libxml-sax-expat-perl all 0.51-1 404 Not Found [IP: 54.39.128.230 80] Err:8 http://http.kali.org/kali kali-rolling/main amd64 texinfo amd64 6.8-3 404 Not Found [IP: 54.39.128.230 80] E: Failed to fetch http://http.kali.org/kali/pool/main/t/tex-common/tex-common_6.17_all.deb 404 Not Found [IP: 54.39.128.230 80] E: Failed to fetch http://http.kali.org/kali/pool/main/libt/libtext-unidecode-perl/libtext-unidecode-perl_1.30-1_all.deb 404 Not Found [IP: 54.39.128.230 80] E: Failed to fetch http://http.kali.org/kali/pool/main/libx/libxml-namespacesupport-perl/libxml-namespacesupport-perl_1.12-1.1_all.deb 404 Not Found [IP: 54.39.128.230 80] E: Failed to fetch http://http.kali.org/kali/pool/main/libx/libxml-sax-base-perl/libxml-sax-base-perl_1.09-1.1_all.deb 404 Not Found [IP: 54.39.128.230 80] E: Failed to fetch http://http.kali.org/kali/pool/main/libx/libxml-sax-perl/libxml-sax-perl_1.02%2bdfsg-3_all.deb 404 Not Found [IP: 54.39.128.230 80] E: Failed to fetch http://http.kali.org/kali/pool/main/libx/libxml-libxml-perl/libxml-libxml-perl_2.0134%2bdfsg-2%2bb1_amd64.deb 404 Not Found [IP: 54.39.128.230 80] E: Failed to fetch http://http.kali.org/kali/pool/main/libx/libxml-sax-expat-perl/libxml-sax-expat-perl_0.51-1_all.deb 404 Not Found [IP: 54.39.128.230 80] E: Failed to fetch http://http.kali.org/kali/pool/main/t/texinfo/texinfo_6.8-3_amd64.deb 404 Not Found [IP: 54.39.128.230 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? ┌──(root💀kali)-[/home/kali]
06-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值