报错: Undefined symbols for architecture i386 error

本文解决XCODE中遇到的Undefined symbols for architecture i386错误,通过添加库文件路径和类文件到编译设置来解决相关问题。

1,如何解决XCODE中错误: Undefined symbols for architecture i386 error

出现Undefined symbols for architecture i386这种错误一般是你用模拟器作为目标,但编译的时候找不到相关的库文件,需要做的就是把库文件所在的位置添加到library search path中。

其它原因可参考下面网址:http://stackoverflow.com/questions/6984368/undefined-symbols-for-architecture-i386-objc-class-skpsmtpmessage-refere    

还有另外一个:http://stackoverflow.com/questions/6610709/undefined-symbols-for-architecture-i386


2,Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error

答案:You can get this type of error if your class' .m file is not listed under the "Compile Sources" step of the "Build Phases" tab of your target. Normally Xcode does this for you, but sometimes it loses the plot and you need to add the .m file manually.

    3,请问为什么在link with lib 种添加  libxml2.dylb  后  引用不了<libxml/tree.h>  老是找不到头文件?

答案:XCODE ,  Project -> Edit Project Settings -> Build Settings

You need to add “/usr/include/libxml2″ to the “Header Search Paths” and you need to add “-lxml2″ to the “Other Linker Flags”.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值